Skip to content

Instantly share code, notes, and snippets.

View gulper.py
#!/usr/bin/env python
import sys
import subprocess
import threading
from clint.textui import puts, colored, indent
def red(msg):
return puts(colored.red(msg, *args, **kwargs))
def cyan(msg, *args, **kwargs):
View gist:820761b7047f5b12bef4
error: Sending 500 ("Server Error") response:
[ { type: 'update',
collection: 'trip',
criteria: { id: 20 },
values: { creator: null },
err:
Error (E_VALIDATION) :: 1 attribute is invalid
:
at WLValidationError.WLError (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/error/WLError.js:33:18)
at new WLValidationError (/usr/local/lib/node_modules/sails/node_modules/waterline/lib/waterline/error/WLValidationError.js:20:28)
View tablib_openpyxl.diff
--- ./tablib/packages/openpyxl/__init__.py 2014-09-23 11:50:22.000000000 +0800
+++ /Users/alex/Downloads/openpyxl/__init__.py 2011-05-13 17:04:34.000000000 +0800
@@ -26,14 +26,14 @@
"""Imports for the openpyxl package."""
# package imports
-from . import cell
-from . import namedrange
-from . import style
-from . import workbook
@rattrayalex
rattrayalex / FluxBone.coffee
Created Oct 5, 2014
FluxBone Mixin for React
View FluxBone.coffee
module.exports =
ModelMixin: (model_name, event_name="all") ->
eventCallbackName = "_eventCallbacks_#{ model_name }_#{ event_name }"
mixin =
componentDidMount: ->
@rattrayalex
rattrayalex / recursive_multiplication.coffee
Last active Aug 29, 2015
recursive multiplication without (-)
View recursive_multiplication.coffee
# Finds product of two positive int's
# using only if, (+), and (===).
# Usage: mult(x, y)
mult = (n1, n2, top=null, orig=null) ->
# sanity check (still assuming positive int's)
if (n1 is 0) or (n2 is 0)
return 0
# on first call
@rattrayalex
rattrayalex / DataProvider.js
Last active Aug 29, 2015
Nuclearjs React DataProvider component
View DataProvider.js
import React from "react"
import Reactor from "./reactor"
function _toJS(x) {
if (x && x.toJS && typeof x.toJS === 'function') {
return x.toJS()
}
return x
}
@rattrayalex
rattrayalex / README.md
Last active Nov 18, 2015
Github pages deploy script
View README.md
View ace_appengine.js
(function (d, cb) {
//
// A script loader over here!
//
if (typeof $LAB === 'undefined') {
var s;
s = d.createElement('script');
View gist:7938649
# alex's logging function that he likes to use.
l = (message, objs...) ->
now = new Date()
hours = now.getHours()
mins = now.getMinutes()
secs = now.getSeconds()
console.log(["#{ hours }:#{ mins }.#{ secs }", message, objs...])
return
# usage:
View ace_codingbat.js
(function (d, cb) {
//
// A script loader over here!
//
if (typeof $LAB === 'undefined') {
var s;
s = d.createElement('script');