- R Markdown
Use a productive notebook interface to weave together narrative text and code to produce elegantly formatted output. Use multiple languages including R, Python, and SQL.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""A sublime-text build script, to do the right thing?. | |
This script takes the currently open file as a | |
reference point and uses it to determine which commands | |
to run. This means that you don't have to select a build | |
commands when switching between projects, the fact that | |
you have a different file open is enough to indicate | |
which build you want to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Table information like sortkeys, unsorted percentage | |
-- see http://docs.aws.amazon.com/redshift/latest/dg/r_SVV_TABLE_INFO.html | |
SELECT * FROM svv_table_info; | |
-- Table sizes in GB | |
SELECT t.name, COUNT(tbl) / 1000.0 AS gb | |
FROM ( | |
SELECT DISTINCT datname, id, name | |
FROM stv_tbl_perm | |
JOIN pg_database ON pg_database.oid = db_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime as dt | |
import sublime_plugin | |
DEV_NAME = "mb" | |
class TODOCommand(sublime_plugin.EventListener): | |
def _todo_str(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
for BRANCH in $(git branch | grep -E -v "^(\* | (develop|master|main)$)"); do | |
if [[ -z $(git --no-pager log develop..$BRANCH --author=$(git config user.email)) ]]; then | |
git branch -D $BRANCH | |
fi | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def getarg(argname, args=sys.argv[1:]): | |
long_arg = '--' + argname | |
short_arg = '-' + argname[:1] | |
for idx, arg in enumerate(args): | |
if arg.startswith(long_arg): | |
if arg == long_arg: | |
# check for parameter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with recursive r(a, b) as ( | |
select 0::int, 1::int | |
union all | |
select b, a + b from r where b < 1000 | |
) | |
select a from r; | |
a | |
----- | |
0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add the following 'help' target to your Makefile | |
# And add help text after each target name starting with '\#\#' | |
help: ## Show this help. | |
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
# Everything below is an example | |
target00: ## This message will show up when typing 'make help' | |
@echo does nothing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<!-- ----------------------------------------------- --> | |
<!-- inline script block with commented code inside: --> | |
<!-- ----------------------------------------------- --> | |
<script id="myjscode"> | |
/* | |
(function(h,v){function q(b){if(""===m)return b; |
NewerOlder