This file contains 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
#!/bin/bash -e | |
# Google Drive file selector by Brian Beck. | |
# Latest version: https://gist.github.com/exogen/9817479 | |
command -v selecta >/dev/null 2>&1 || { | |
echo >&2 "This utility requires selecta to be installed:" | |
echo >&2 | |
echo >&2 " https://github.com/garybernhardt/selecta" | |
echo >&2 |
This file contains 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
#!/bin/bash | |
# Usage: play bizarre love triangle | |
# Arguments are joined so no quotes are needed. | |
# NOTE: $TMPDIR (on Mac at least) already ends in a slash. | |
youtube-dl --default-search "ytsearch" \ | |
--restrict-filenames \ | |
--output "${TMPDIR:-/tmp/}%(title)s-%(id)s.%(ext)s" \ | |
--exec afplay "$*" |
This file contains 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 re | |
import itertools | |
key_re = re.compile(r'(.*?)(\d*)$') | |
def string_key(s): | |
name, number = key_re.match(s).groups() | |
return (name, number and int(number)) | |
def group_key((i, (name, number))): |
This file contains 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 inspect | |
class Meta(type): | |
def __init__(cls, name, bases, attrs): | |
for attr, value in attrs.items(): | |
if inspect.isfunction(value): | |
setattr(cls, attr, decorate(value)) | |
for base in bases: | |
for attr in dir(base): | |
value = getattr(base, attr) |
This file contains 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
ko = {}; | |
ko.Observable = function(value) { | |
this.value = value; | |
this.subscribers = []; | |
}; | |
ko.Observable.prototype.get = function() { | |
return this.value; |
This file contains 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
ko = require 'knockout' | |
Milk = require 'milk' | |
class Template | |
constructor: (@string) -> | |
render: (data, options) => | |
# Knockout expects an Array-like object of Nodes. | |
# We could just use createElement and set innerHTML, | |
# but apparently jQuery's append does some kind of cleanup. |
This file contains 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
# Go to the #{lol} line and press 'o'. | |
rofl = """ | |
#{lol} | |
""" |
This file contains 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
/** | |
* Script loading is difficult thanks to IE. We need callbacks to fire | |
* immediately following the script's execution, with no other scripts | |
* running in between. If other scripts on the page are able to run | |
* between our script and its callback, bad things can happen, such as | |
* `jQuery.noConflict` not being called in time, resulting in plugins | |
* latching onto our version of jQuery, etc. | |
* | |
* For IE<10 we use a relatively well-documented 'preloading' strategy, | |
* which ensures that the script is ready to execute *before* appending |
This file contains 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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import Playground from 'component-playground'; | |
const examples = { | |
block: require('raw!./examples/block.example') | |
} | |
class Demo extends React.Component { | |
render() { |
This file contains 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
<VictoryChart | |
interpolation="basis" | |
axisLabels={{x: "x axis", y: "y axis"}} | |
x={[ | |
[1, 2, 3, 4], | |
[-2, -1, 0, 1, 3], | |
[3, 4, 6] | |
]} | |
y={[ | |
[1, 2, 10, 4], |
OlderNewer