Skip to content

Instantly share code, notes, and snippets.

View davidcelis's full-sized avatar
Verified account

David Celis davidcelis

Verified account
View GitHub Profile
@davidcelis
davidcelis / config.ru
Created March 6, 2012 18:35
Rails Lightweight Stack. Most of this is detailed on Crafting Rails Applications - http://pragprog.com/book/jvrails/crafting-rails-applications
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin`
# Be sure to have rails and thin installed.
require "rubygems"
# We are not loading Active Record, nor the Assets Pipeline, etc.
# This could also be in your Gemfile.
gem "actionpack", "~> 3.2"
gem "railties", "~> 3.2"
# The following lines should come as no surprise. Except by
@davidcelis
davidcelis / gist:2128441
Created March 19, 2012 23:32 — forked from marcel/gist:2100703
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
@davidcelis
davidcelis / emoji.txt
Created April 3, 2012 20:59 — forked from stephencelis/emoji.txt
Emoji not on the iOS Keyboard
2139 ℹ INFORMATION SOURCE
23EB ⏫ BLACK UP-POINTING DOUBLE TRIANGLE
23EC ⏬ BLACK DOWN-POINTING DOUBLE TRIANGLE
23F0 ⏰ ALARM CLOCK
23F3 ⏳ HOURGLASS WITH FLOWING SAND
26C5 ⛅ SUN BEHIND CLOUD
26D4 ⛔ NO ENTRY
2705 ✅ WHITE HEAVY CHECK MARK
2753 ❓ BLACK QUESTION MARK ORNAMENT
2757 ❗ HEAVY EXCLAMATION MARK SYMBOL
@davidcelis
davidcelis / syntax_highlighting.py
Created April 12, 2012 22:05 — forked from phillipkoebbe/syntax_highlighting.py
Syntax highlight switcher for Sublime Text 2
import sublime, sublime_plugin
import os, string, re
class DetectFileTypeCommand(sublime_plugin.EventListener):
""" Attempts to choose the correct syntax when more than one could apply. """
def __init__(self):
super(DetectFileTypeCommand, self).__init__()
self.path = None
@davidcelis
davidcelis / gist:3012391
Created June 28, 2012 16:38 — forked from edhedges/gist:2995805
Sublime Text 2 - Useful Shortcuts (Mac OS X)

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@davidcelis
davidcelis / lyrics
Created June 29, 2012 22:52 — forked from jhob/lyrics
Adds Rdio and Spotify support
#!/bin/bash
services=(iTunes Rdio Spotify)
for service in "${services[@]}"; do
if ps axco pid,command | grep -v grep | egrep "$service\$" > /dev/null; then
state=`osascript -e "tell application \"$service\" to get player state as string"`
if [ "$state" = "playing" ] ; then
artist_name=`osascript -e"tell application \"$service\" to get artist of current track"`
song_title=`osascript -e"tell application \"$service\" to get name of current track"`
artist=`echo $artist_name | sed "s/[[:space:]]/%20/g"`
@davidcelis
davidcelis / gist:3211214
Created July 30, 2012 22:37 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@davidcelis
davidcelis / falcon.patch
Created November 12, 2012 18:03 — forked from funny-falcon/falcon.patch
Performance patch for ruby-1.9.3-head (applies to p194 as well)
diff --git a/array.c b/array.c
index 64647c3..618d9e3 100644
--- a/array.c
+++ b/array.c
@@ -255,15 +255,24 @@ rb_ary_modify(VALUE ary)
rb_ary_modify_check(ary);
if (ARY_SHARED_P(ary)) {
long len = RARRAY_LEN(ary);
+ VALUE shared = ARY_SHARED(ary);
if (len <= RARRAY_EMBED_LEN_MAX) {
@davidcelis
davidcelis / 1.9.3-p362-perf.md
Last active October 17, 2016 11:28 — forked from burke/0-readme.md
Ruby 1.9.3-p362 cumulative performance patch for rbenv

NOTE: THIS PATCH DOES NOT APPLY. Falcon's performance patches have not been updated for p362. See the comments for a fork that uses the Rails Express patch set instead.

ruby-1.9.3-p362 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p362 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

#!/usr/bin/env sh
if ! which md5sum > /dev/null; then
echo Install md5sum
exit 1
fi
if ! which curl > /dev/null; then
echo Install curl
exit 1