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 json1 from 'ot-json1' | |
const integerRegEx = /^\d+$/ | |
function isInteger (v) { | |
return Boolean(v.match(integerRegEx)) | |
} | |
export function patchAtomToOpAtom (patchOp) { | |
const { path, op, value } = patchOp | |
const pathArray = path.split('/').slice(1).map(pathItem => { |
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
int counter = 0; | |
int signalPin = 3; | |
int feeding = 1; | |
int msPerPulse = 100; | |
int msPerPulseInterval = 500; | |
// Feed time (affects how much material to feed) | |
int numPulses = 25; | |
int delayPerPulse = 100; |
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
source ~/.zplug/init.zsh | |
zplug "plugins/git", from:oh-my-zsh | |
zplug "plugins/tmux", from:oh-my-zsh | |
zplug "themes/robbyrussell", from:oh-my-zsh | |
ZSH_THEME="robbyrussell" | |
zplug load | |
# oh-my-zsh config. | |
export ZSH=$HOME/.oh-my-zsh | |
plugins=(git tmux) |
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
#!/usr/bin/env python | |
import sys | |
import os | |
import string | |
import random | |
import subprocess | |
import multiprocessing | |
class NotAuthorizedException(Exception): pass |
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
''' | |
adminreverse from here http://djangosnippets.org/snippets/2032/ | |
changed for working with ForeignKeys | |
''' | |
''' | |
reverseadmin | |
============ | |
Module that makes django admin handle OneToOneFields in a better way. | |
A common use case for one-to-one relationships is to "embed" a model | |
inside another one. For example, a Person may have multiple foreign |
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
#!/usr/bin/env python | |
""" | |
A Flask-powered math engine microservice. | |
""" | |
from flask import Flask, request, jsonify, Response | |
import json | |
import datetime |
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
#!/usr/bin/env python | |
""" | |
Number-to-spoken-numbers converter. | |
""" | |
max_value = 10**66 - 1 | |
big_words = { | |
3: "thousand", | |
6: "million", |
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
var audioContext = null; | |
var isPlaying = false; // Are we currently playing? | |
var startTime; // The start time of the entire sequence. | |
var current16thNote; // What note is currently last scheduled? | |
var tempo = 80; // tempo (in beats per minute) | |
var lookahead = 25.0; // How frequently to call scheduling function | |
//(in milliseconds) | |
var scheduleAheadTime = 0.1; // How far ahead to schedule audio (sec) | |
// This is calculated from lookahead, and overlaps | |
// with next interval (in case the timer is late) |
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
from javax.swing import (Spring, SpringLayout) | |
def makeGrid(parent, rows,cols, initialX, initialY, xPad, yPad): | |
layout = parent.getLayout() | |
xPadSpring = Spring.constant(xPad) | |
yPadSpring = Spring.constant(yPad) | |
initialXSpring = Spring.constant(initialX) | |
initialYSpring = Spring.constant(initialY) | |
max_ = rows * cols |
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
Copying all dependencies to a dir: | |
mvn dependency:copy-dependencies -DoutputDirectory=/tmp/foo | |
Listing dependencies: | |
mvn dependency:resolve -DoutputFile=/tmp/bar.txt | |
per these pages: | |
http://maven.apache.org/plugins/maven-dependency-plugin/usage.html | |
http://maven.apache.org/plugins/maven-dependency-plugin/list-mojo.html |
NewerOlder