Skip to content

Instantly share code, notes, and snippets.

View rattrayalex's full-sized avatar

Alex Rattray rattrayalex

View GitHub Profile
(function (d, cb) {
//
// A script loader over here!
//
if (typeof $LAB === 'undefined') {
var s;
s = d.createElement('script');
# 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:
(function (d, cb) {
//
// A script loader over here!
//
if (typeof $LAB === 'undefined') {
var s;
s = d.createElement('script');
@rattrayalex
rattrayalex / README.md
Last active November 18, 2015 00:21
Github pages deploy script
@rattrayalex
rattrayalex / gulper.py
Last active August 29, 2015 14:01
Gulp Runner
#!/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):
@rattrayalex
rattrayalex / shellshower.py
Created June 11, 2014 20:02
show commands that are being run
from clint.textui import puts, indent, colored
def red(msg):
return puts(colored.red(msg))
def shell(cmd, fail_silently=False, *args, **kwargs):
# tell the user what's about to go out
puts(colored.blue("-> {}".format(cmd)))
@rattrayalex
rattrayalex / gist:820761b7047f5b12bef4
Created August 31, 2014 10:23
sails destroy error
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)
@rattrayalex
rattrayalex / MessageStore_FluxBone.js
Last active June 19, 2020 09:40
Flux and Backbone
var ChatAppDispatcher = require('../dispatcher/ChatAppDispatcher');
var ChatConstants = require('../constants/ChatConstants');
var ChatMessageUtils = require('../utils/ChatMessageUtils');
var EventEmitter = require('events').EventEmitter;
var ThreadStore = require('../stores/ThreadStore');
var merge = require('react/lib/merge');
var ActionTypes = ChatConstants.ActionTypes;
var CHANGE_EVENT = 'change';
--- ./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 October 5, 2014 03:51
FluxBone Mixin for React
module.exports =
ModelMixin: (model_name, event_name="all") ->
eventCallbackName = "_eventCallbacks_#{ model_name }_#{ event_name }"
mixin =
componentDidMount: ->