Skip to content

Instantly share code, notes, and snippets.

View oconnore's full-sized avatar

Eric O'Connor oconnore

View GitHub Profile
# ===================================================================
# Git Configuration
#
# Bundle interface:
#
# git_repo(owner, group, path, shared, remote_name, remote, force)
# git_umask(owner, group, path, shared)
# git_worktree(owner, group, path, parent, force)
# git_fetch(owner, group, path, remote)
# git_checkout(owner, group, path, remote, branch, commit)
@oconnore
oconnore / Tree.h
Last active June 7, 2016 22:04
Hierarchical Tree in C++14
#pragma once
#include <algorithm>
#include <exception>
#include <map>
#include <memory>
#include <stack>
#include <stdexcept>
#include <string>
#include <utility>
@oconnore
oconnore / nix.cf
Created February 23, 2016 20:29
CFengine Nix promises
# ==============================================================
# Nix Configuration
# ==============================================================
bundle agent nix_setup {
files:
"/etc/nix/users"
create => "true",
perms => mog("644", "root", "root"),
copy_from => _copy_file("$(g.files)/nix_users"),
@oconnore
oconnore / harmonyEnumerableCollections.js
Last active December 30, 2015 22:49
Allow enumeration of harmony collections in node.js (relies on generators and non-enumerable collections).
// AMD header
if (typeof define !== 'function') {
var define = require('amdefine')(module);
}
define(function() {
'use strict';
var priv = new WeakMap();
@oconnore
oconnore / mozAlarms.js
Created November 25, 2013 21:00
'alarm' message handler issue
(function() {
'use strict';
var received = false;
navigator.mozSetMessageHandler('alarm', function(ev) {
received = true;
console.log('message handled ->', JSON.stringify(ev));
});
@oconnore
oconnore / get-build.sh
Created October 23, 2013 15:13
Extract a gaia build for debugging : ./get-build.sh <system> [<cat-path>] ... for example: ./get-build.sh clock js/startup.js
#!/bin/sh
set -e
rm -r extracted
mkdir -p extracted
FOUND=`find profile/webapps/ -name "$1".gaiamobile.org | wc -l`
if [ "$FOUND" -gt 0 ]; then
APP="$1"
TARGET="profile/webapps/$1.gaiamobile.org/"
else
;;;
;;; Study Hall #1
;;; example lisp code, by Eric O'Connor
;;;
;; define a package
(defpackage play
(:use cl))
;; use the package
@oconnore
oconnore / tweet-words.txt
Created October 3, 2013 19:20
Tweet words
about 55
think 33
people 30
would 24
because 22
right 19
there 19
awesome 17
twitter 16
really 16
@oconnore
oconnore / arasbm.diff
Created August 30, 2013 18:54
Rebased Bugzilla 873574 to master
commit 1457958c78ae4db8c5babaeb01fce46d3ccf6c81
Author: arasbm@gmail.com
Date: Fri Aug 30 14:40:35 2013 -0400
bug-873574 - scroll indicators for alarms list - performance improved
performance improvements for alarm list scroll indicators
* limit execution of `showHideScrollIndicators` to one per 150ms
* set threshold for showing and hiding indicators relative to alarm cell height
@oconnore
oconnore / gist:6167039
Created August 6, 2013 18:12
USB issues
Aug 6 14:11:34 tara kernel: [ 400.708678] usb 3-2: new high-speed USB device number 16 using xhci_hcd
Aug 6 14:11:36 tara kernel: [ 402.494495] usb 3-2: Device not responding to set address.
Aug 6 14:11:36 tara kernel: [ 402.696774] usb 3-2: Device not responding to set address.
Aug 6 14:11:36 tara kernel: [ 402.900304] usb 3-2: device not accepting address 16, error -71
Aug 6 14:11:36 tara kernel: [ 402.956223] hub 3-0:1.0: unable to enumerate USB device on port 2
Aug 6 14:11:36 tara kernel: [ 403.195724] usb 3-2: new high-speed USB device number 18 using xhci_hcd
Aug 6 14:11:38 tara kernel: [ 405.003467] usb 3-2: Device not responding to set address.
Aug 6 14:11:39 tara kernel: [ 405.203733] usb 3-2: Device not responding to set address.
Aug 6 14:11:39 tara kernel: [ 405.407299] usb 3-2: device not accepting address 18, error -71
Aug 6 14:11:39 tara kernel: [ 405.463236] hub 3-0:1.0: unable to enumerate USB device on port 2