Skip to content

Instantly share code, notes, and snippets.

Luke Thomas luk3thomas

Block or report user

Report or block luk3thomas

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@luk3thomas
luk3thomas / _readme.md
Last active Aug 7, 2018
A config wrapper for Elixir
View _readme.md
@luk3thomas
luk3thomas / Gemfile
Created Feb 22, 2018
Proxy to staging
View Gemfile
source "https://rubygems.org"
gem "rack"
gem "rack-proxy"
@luk3thomas
luk3thomas / send-stats.js
Last active Mar 27, 2018
Send chrome memory usage stats to librato
View send-stats.js
// 1. Go to chrome://memory-redirect/
// 2. Paste this script into the developer console
(function(){
var SERVER = 'http://localhost:4567/', // Post metrics to any server
STRINGS = 'chrome://memory-redirect/strings.js',
INTERVAL = 10e3,
RE_INCLUDE = /./; // only include certain results, if you want.
function getMemoryStats() {
@luk3thomas
luk3thomas / README.md
Last active Dec 27, 2015
This is the typical setup I use when I create a JS library.
View README.md

Setup

npm install --save-dev babel-core \
  babel-loader \
  babel-preset-es2015 \
  eslint \
  eslint-config-airbnb \
  imports-loader \
  jasmine \
@luk3thomas
luk3thomas / sortBy-spec.coffee
Last active Aug 29, 2015
Crazy sort using eval
View sortBy-spec.coffee
describe "#sortBy", ->
it "sorts on simple props", ->
sorted = [ {name: "bar"}, {name: "baz"}, {name: "foo"} ]
unsorted = [ {name: "foo"}, {name: "bar"}, {name: "baz"} ]
expect(unsorted.sort(sortBy("name"))).toEqual(sorted)
it "sorts in nested objects", ->
unsorted = [ {name: first: "foo"}, {name: first: "bar"}, {name: first: "baz"} ]
View functional.coffee
toArray = (d) -> [].slice.call(d)
currify = (fn, args, remaining)->
if remaining < 1
return fn.apply(null, args)
->
currify(fn, args.slice(0, fn.length - 1).concat(toArray(arguments)), remaining - arguments.length)
@luk3thomas
luk3thomas / gulpfile.coffee
Last active Aug 29, 2015
working example of gulp, coffeescript, react, jsx, browserify
View gulpfile.coffee
sys = require "sys"
exec = require("child_process").exec
spawn = require("child_process").spawn
browserify = require "browserify"
watchify = require "watchify"
coffee_react = require "coffee-reactify"
gulp = require "gulp"
jade = require "gulp-jade"
plumber = require "gulp-plumber"
reload = require "gulp-livereload"
View cardModel.coffee
Model = require "lib/model"
class Card extends Model
defaults:
name: ""
value: ""
transform: (name, value)->
@luk3thomas
luk3thomas / _mixins.scss
Created Apr 21, 2014
Bootstraps's less mixins for sass, way back when
View _mixins.scss
// Mixins.less
// Snippets of reusable CSS to develop faster and keep code readable
// -----------------------------------------------------------------
// IE7 inline-block
// ----------------
@mixin ie7-inline-block() {
*display: inline; /* IE7 inline-block hack */
*zoom: 1;
You can’t perform that action at this time.