Skip to content

Instantly share code, notes, and snippets.

View pmarreck's full-sized avatar

Peter Marreck pmarreck

  • formerly desk.com, thredup.com and lifebooker.com. currently Director of Engineering @addigence
  • Long Island, NY
  • 20:50 (UTC -04:00)
View GitHub Profile
@pmarreck
pmarreck / new_auto_link_regex_constant.rb
Created June 19, 2012 20:37
A URI detector/parser regex that is a better, but slower, auto_link regex for Rails (and a line that patches it in)
@SchizoDuckie
SchizoDuckie / apf_release.prepend.js
Created March 20, 2012 20:19
Cloud9 IDE Touch Enabler Monkeypatch
/**
* A proof of concept monkeypatch to make Cloud9 IDE work on a tablet.
* Since i'm an extremely lazy bastard I prepended this snippet directly in package/client/js/apf_release.js
*
* What does it do?
* - It fires a doubleclick for a 2-finger tap
* - It fires a mousewheel up / down event for a 2-finger swipe up / down.
*
* How does it work?
* Prepend the functions below to <cloud9>/package/client/js/apf_release.js, save, load in tablet.
@netmute
netmute / README.md
Last active October 27, 2022 13:22
Game of Life

Game of Life

An implementation of Conway's Game of Life in 140 characters of Ruby.

Author

Created by Simon Ernst (@sier).

@bkimble
bkimble / gist:1365005
Last active March 22, 2024 19:21
List local memcached keys using Ruby
#!/usr/bin/env ruby
# List all keys stored in memcache.
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place.
require 'net/telnet'
headings = %w(id expires bytes cache_key)
rows = []
@devpuppy
devpuppy / nokogiri libxml homebrew lion
Created November 8, 2011 23:26
How to fix: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
FIXME:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
or
libxml_ruby.bundle: dlsym(0x10fde1900, Init_libxml_ruby): symbol not found
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
@ogredude
ogredude / mandelbrot.rb
Created August 4, 2011 20:46
Mandelbrot generator in 111 characters!
80.times{|a|p (0..300).map{|b|x=y=i=0;(x,y,i=x*x-y*y+b/150.0-1.5,2*x*y+a/40.0-1,i+1)until(x*x+y*y>4||i>98);i>98?0:1}*''}
@perimosocordiae
perimosocordiae / forth.rb
Created February 10, 2010 18:58
A pure Ruby interpreter for Forth
#!/usr/bin/env ruby
# the stack
$stack = []
def pop() $stack.pop || ufe end
def push(f) $stack<<f end
# poor man's Exception class
def ufe() raise("Stack underflow") end
# lambda constructor helpers