Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍👩‍👧‍👦
being a dad

Jeff Larson thejefflarson

👨‍👩‍👧‍👦
being a dad
View GitHub Profile
View backgroundcompaction.rb
module Daybreak
class BackgroundCompaction
def initialize(file, options = {})
@db = Daybreak::DB.new(file)
@thread = Thread.new(&method(:run))
@options = options
end
def stop
@stop = true
View daybreak.rb
require 'thread'
require 'zlib'
class Daybreak
include Enumerable
def initialize(file)
@file = file
@out = File.open(@file, 'ab')
@queue = Queue.new
View gist:1503043
+-----------------------------+
| ^^^^ / ~|
| ^^^ --------- /|
| ^^ Simple / -------- |
| / ~ / ** |
| / / **** |
| ---- ~ / ****** |
| / ~~ --- ****** |
| / / **** |
| / ~~ / ⌂⌂⌂⌂|
View NYTCween.js
function(){
var $$ = function(query){
!!(query && query.nodeType == 1) ?
this.dom = [query]
:
this.dom = [].slice.call(document.querySelectorAll(query));
};
$$.prototype.remove = function(){
this.dom[0].parentNode.removeChild(this.dom);
View NYTCween.js
(function(){
var $$ = function(query){
!!(query && query.nodeType == 1) ?
this.dom = query
:
this.dom = document.getElementById(query);
};
$$.prototype.remove = function(){
this.dom.parentNode.removeChild(this.dom);
View NYTCween.js
(function(){
var $$ = function(query){
!!(query && query.nodeType == 1) ?
this.dom = query
:
this.dom = document.getElementById(query);
};
$$.prototype.remove = function(){
this.dom.parentNode.removeChild(this.dom);
View NYTCween.js
(function(){
var $$ = function(query){
!!(query && query.nodeType == 1) ?
this.dom = query
:
this.dom = document.getElementById(query);
};
$$.prototype.remove = function(){
this.dom.parentNode.removeChild(this.dom);