Skip to content

Instantly share code, notes, and snippets.

View rjungemann's full-sized avatar

Roger Jungemann rjungemann

View GitHub Profile
@rjungemann
rjungemann / phantom.js
Created May 9, 2011 07:32
Run phantom and node in parallel from node, for integration testing or other purposes. Serializes a node function and runs it in phantom, and runs another node function in parallel.
require.paths.unshift(__dirname + '/../lib');
var fs = require('fs');
var exec = require('child_process').exec;
function uuid() {
return '________-____-____-____-____________'.replace(/\_/g, function(n) {
return Math.floor(Math.random() * 16).toString(16);
});
}
@rjungemann
rjungemann / ctags.rb
Created March 19, 2011 19:03
An Exuberant Ctags formula that works with Vim
require 'formula'
# An older version, 5.6, is necessary to work with Vim's Taglist plugin.
class Ctags < Formula
url 'http://downloads.sourceforge.net/ctags/ctags-5.6.tar.gz'
homepage 'http://ctags.sourceforge.net/'
md5 '9026a6c6950751bc4fd1be37e8a2070f'
head 'https://ctags.svn.sourceforge.net/svnroot/ctags/trunk'
@rjungemann
rjungemann / main.coffee
Created March 11, 2011 18:59
Work-in-progress RESTful wiki using Node + Connect + CoffeeScript
require.paths.unshift 'vendor/connect/lib'
require.paths.unshift 'vendor/markdown-js/lib'
connect = require 'connect'
markdown = require 'markdown'
class CoffeeWiki
constructor: ->
# The endpoint for the wiki.
@baseUrl = '/pages'
@rjungemann
rjungemann / gist:863292
Created March 10, 2011 00:08
Single-line password generator
# http://codegolf.stackexchange.com/questions/1360/how-to-write-a-single-line-password-generator
a = [('a'..'z'), ('A'..'Z'), (0..9)].map { |n| n.to_a }.flatten
puts (0...8).map { a[a.size * rand] }.join
@rjungemann
rjungemann / zsh_bookmarks.sh
Created March 2, 2011 00:53
ZSH bookmarks
# http://news.ycombinator.net/item?id=2238846
# enable zsh bookmarks
# example:
# b chuck # bookmark current directory as "chuck"
# ~chuck # recall the "chuck" directory
touch ~/.zshmarks && source ~/.zshmarks
function b() {
echo "hash -d $1=\"`pwd`\"" >> ~/.zshmarks && source ~/.zshmarks
}
@rjungemann
rjungemann / steps.coffee
Created February 17, 2011 17:12
Different flow control ideas for CoffeeScript ("normal", "step", and "hop")
# odd synchronus patterns -- purported 'monadic' flow control
events = require 'events'
step = (callback) ->
first = true
queue = []
emitter = new events.EventEmitter
this.step = (callback) ->
/*
Syntax error: Undefined variable: "$host".
on line 21 of /Users/wildfireinteractive/Development/messenger/public/stylesheets/ui_toolkit/sass/ui/jquery-ui.custom.scss
16: .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
17:
18: .ui-widget { font-family: Helvetica Neue,Arial,sans-serif; font-size: 1.1em; }
19: .ui-widget .ui-widget { font-size: 1em; }
20: .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Helvetica Neue,Arial,sans-serif; font-size: 1em; }
21: .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(#{$host}/jquery_ui/ui-bg_flat_100_ffffff_40x100.png) 50% 50% repeat-x; color: #333333; }
.gitignore | 1 +
Gemfile | 3 +-
Gemfile.lock | 14 +-
app/controllers/messages_controller.rb | 1 +
app/controllers/recipients_controller.rb | 82 ++++++++++
app/helpers/recipients_helper.rb | 2 +
app/models/message.rb | 25 +++-
app/views/messages/_form.html.haml | 71 +--------
app/views/recipients/_recipient.json.haml | 6 +
config/routes.rb | 5 +
<!-- an example "friend label" -->
<div class='friend_container'>
<div class='friend_image'>
<div class='image'></div>
</div>
<div class='friend_name'>@adorableLizard</div>
<div class='friend_info'>Twitter User</div>
</div>
class UiController < ApplicationController
layout 'standard_with_top'
def index
end
def buttons
end
def accordion