Skip to content

Instantly share code, notes, and snippets.


Eric Miller SimplGy

View GitHub Profile
toolness / baconjs-infinite-scroll.html
Last active Aug 29, 2015
An attempt to implement infinite scrolling using Bacon.js, a Functional Reactive Programming (FRP) library.
View baconjs-infinite-scroll.html
<!DOCTYPE html>
<meta charset="utf-8">
<title>Bacon.js Infinite Scroll Attempt #2</title>
<p>Keep scrolling down to see more numbers.</p>
<div id="results"></div>
<img id="throbber" src="" style="position: fixed; bottom: 4px; right: 4px;">
<script src="//"></script>
<script src="//"></script>
var pageChanged = new Bacon.Bus();
gilesbowkett /
Created Sep 29, 2011
jasmine.Matchers.prototype.toBeInstanceOf = (klass) ->
this.actual instanceof klass
View animationPlay
@function foo-shadow($color, $size, $layers: 1) {
$transparency: (10 - $layers) * .1;
$opts: ();
@for $i from 1 to $layers {
$opts: append($opts, 0 0 0 ($size * $i) transparentize($color, $transparency + (.1 * $i)), comma);
@return $opts;
$colorGood: lawngreen;
thebyrd / magicMethod.js
Last active Dec 19, 2015
Adds jQuery style getters and setters to a given constructor function.
View magicMethod.js
Function.prototype.method = function (name, func) {
this.prototype[name] = func;
return this;
var getParamNames = function (func) {
var funStr = func.toString()
return funStr.slice(funStr.indexOf('(')+1, funStr.indexOf(')')).match(/([^\s,]+)/g)
View tyga.js
// Make it Nasty
function increment (i) {
i ^= (i & ~-~i) | (~i & -~i)
return i

Rough outline of asset deployment strategy


  • Separate front end "client" deployment and build process from backend deployment.
  • Not necessarily have to create two completely distinct applications (because of authentication difficulties etc), but could go in that direction if needed.
  • Migratable to from the asset pipeline & compatible with rails.
  • Support coffeescript, sass compilation.
  • Allow lightweight "staging" clients to be deployed using the existing backend. Ideally even use the production backend with a development client.
  • Fast compilation and deployment.
View ErrorFormatter.h
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface ErrorFormatter : NSObject
@property (strong, nonatomic) NSError *error;
- (id)initWithError:(NSError *)error;
- (UIAlertView *)alert;
christophercliff / Makefile
Created Dec 14, 2012
Makefile for deploying a Wintersmith static site to Github Pages without exposing the source (assumes you're using the default build directory).
View Makefile
rm -rf ./build
wintersmith build
cd ./build && \
git init . && \
git add . && \
git commit -m "Deploy"; \
git push "{YOUR NAME}/{YOUR REPO}.git" master:gh-pages --force && \
rm -rf .git
kristopherjohnson / contentsOfDirectoryAtPath.swift
Last active Nov 15, 2017
Using NSFileManager contentsOfDirectoryAtPath in Swift, with tuple result and CPS interfaces
View contentsOfDirectoryAtPath.swift
import Foundation
// Tuple result
// Get contents of directory at specified path, returning (filenames, nil) or (nil, error)
func contentsOfDirectoryAtPath(path: String) -> (filenames: String[]?, error: NSError?) {
var error: NSError? = nil
let fileManager = NSFileManager.defaultManager()
let contents = fileManager.contentsOfDirectoryAtPath(path, error: &error)
View nostalgia.swift
Sometimes letting go doesn't mean saying goodbye
prefix operator ++
prefix operator --
postfix operator ++
You can’t perform that action at this time.