Skip to content

Instantly share code, notes, and snippets.

View drd's full-sized avatar

Eric O'Connell drd

View GitHub Profile
struct ControlGrid {
var buttons : Dictionary<String, NSButton>
let mapping = [
"e": (1, 0.5),
"se": (1, 1),
"s": (0.5, 1),
"sw": (0, 1),
"w": (0, 0.5),
"nw": (0, 0),
@drd
drd / fail.swift
Created September 1, 2014 06:09
where is the bug?
func testOMGWTF() {
var err: NSError?
let plist = [
"a": "c",
// note that 1 is a String
"b": "1"
]
let data = NSPropertyListSerialization.dataWithPropertyList(
plist,
format: NSPropertyListFormat.BinaryFormat_v1_0,
@drd
drd / does-not-work
Created October 10, 2014 18:29
Help me figure out why the path of the bundle affects npm module resolution?
# browserifying a bundle from the exact same working directory but where the
# target is elsewhere (the package i'm trying to build for release)
# fails to find the reactify module;
[eric@lxc000 app-ido-i3 (develop *)]$ bash -c "source develop; /Users/eric/work/app-ido-i3/front-end/blue-1/../../node_modules/.bin/browserify -t reactify /idealist/releases/permastatic-v0.0/resource/blue-1/js/abc.bundle.jsx"
Ready.
Error: Cannot find module 'reactify' from '/idealist/releases/permastatic-v0.0/resource/blue-1/js'
at /Users/eric/work/app-ido-i3/node_modules/browserify/node_modules/resolve/lib/async.js:50:17
at process (/Users/eric/work/app-ido-i3/node_modules/browserify/node_modules/resolve/lib/async.js:119:43)
at /Users/eric/work/app-ido-i3/node_modules/browserify/node_modules/resolve/lib/async.js:128:21
at load (/Users/eric/work/app-ido-i3/node_modules/browserify/node_modules/resolve/lib/async.js:60:43)
@drd
drd / gist:cd591e52442a25bbb010
Created June 3, 2015 22:11
Coverage with babel/require
--------------------------------|-----------|-----------|-----------|-----------|
File | % Stmts |% Branches | % Funcs | % Lines |
--------------------------------|-----------|-----------|-----------|-----------|
src/ | 80.32 | 71.93 | 70.42 | 80.95 |
FormController.js | 76.92 | 65 | 72.22 | 72.22 |
PageComponentLoader.jsx | 33.33 | 100 | 0 | 33.33 |
Router.jsx | 89.47 | 70 | 86.67 | 89.47 |
Wish.jsx | 66.67 | 92.31 | 50 | 65.91 |
World.jsx | 91.84 | 64.29 | 92.31 | 97.83 |
config.js | 100 | 100 | 100 | 100 |
let isObject = o => toString.call(o) === '[object Object]'
let consume = i => {
let iterator = i && i.keys;
if (!iterator) return;
let arr = [];
while (res = iterator.next(), !res.isDone) arr.push(res.value);
return res;
}
@drd
drd / Sakefile
Created August 31, 2008 19:03 — forked from cwsaylor/Sakefile
namespace 'rails' do
desc 'Remove rails tmp dirs'
task 'rm_tmp_dirs' do
["./tmp/pids", "./tmp/sessions", "./tmp/sockets", "./tmp/cache"].each do |f|
system("rmdir ./#{f}")
end
end
end
namespace 'git' do
@drd
drd / gist:11313
Created September 17, 2008 21:24 — forked from tamalw/gist:11302
# Models
class Agent < ActiveRecord::Base
belongs_to :manager
belongs_to :site
belongs_to :workgroup
named_scope :of_workgroup, lambda { |workgroup| {:conditions => ['workgroup_id = ?', @workgroup.id] }
end
#Install gems
gem 'mocha'
gem 'thoughtbot-shoulda'
gem 'thoughtbot-factory_girl'
gem 'technicalpickles-shoulda_generator'
gem 'mislav-will_paginate', :version => '~> 2.2.3', :lib => 'will_paginate', :source => 'http://gems.github.com'
gem 'haml'
#install plugins
@drd
drd / gist:300753
Created February 10, 2010 19:35 — forked from greghaynes/gist:300209
// This software is released under the DBAD (Dont be a duche) license.
// If you improve this code in any way, you must release your modifications publicly.
#include "Map.h"
#include <string>
#include <vector>
#include <iostream>
#define DEPTH 1
Rails CMS alternatives
======================
Note: project activity was checked on 11/26/09 for most of these projects, and the "last update" field has not been kept up to date since then.
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09