Skip to content

Instantly share code, notes, and snippets.

@abeyer
abeyer / start_tmux.sh
Created October 12, 2015 02:21
chromebook devenv startup
# handle (most of) the color/encoding issues w/ using vim+solarized+tmux under crouton in the chrome shell window
export TERM=xterm-256color
export LC_ALL=en_US.utf-8
export LC_LANG=en_US.utf-8
tmux -2
@abeyer
abeyer / quickjinja.py
Created September 11, 2015 19:55
splat json data on a jinja2 template from the command line
import json
import click
from jinja2 import Environment, FileSystemLoader, StrictUndefined
@click.command()
@click.argument('template_file')
@click.argument('data_file')
def main(template_file, data_file):
env = Environment(loader=FileSystemLoader(searchpath='.'), undefined=StrictUndefined)
/*
* Scrapes text Q&A data out of a Quizlet deck list view
*
* usage: paste this function into developer console, then
* copy(scrape_quizlet()) to get a JSON string on
* the clipboard.
*/
function scrape_quizlet() {
var get_text = function(i,elem) { return jQuery(elem).text(); };
Function ConCat(Delimiter As Variant, ParamArray CellRanges() As Variant) As String
Dim Cell As Range, Area As Variant
If IsMissing(Delimiter) Then Delimiter = ""
For Each Area In CellRanges
If TypeName(Area) = "Range" Then
For Each Cell In Area
If Len(Cell.Value) Then ConCat = ConCat & Delimiter & Cell.Value
Next
Else
ConCat = ConCat & Delimiter & Area