Skip to content

Instantly share code, notes, and snippets.

@smith
smith / gist:959081
Created May 6, 2011 14:54 — forked from jtimberman/gist:881058
i can has ruby-1.9.2 package with fpm
# Commands to build a .deb with ruby 1.9.2
apt-get install libssl-dev
gem install fpm
cd /usr/src
wget ftp://ftp.ruby-lang.org//pub/ruby/1.9/ruby-1.9.2-p180.tar.gz
tar -zxvf ruby-1.9.2-p180.tar.gz
cd ruby-1.9.2-p180
./configure --prefix=/usr && make && make install DESTDIR=/tmp/installdir
cd ..
# This builds the package. Replace x86_64 with i386 or the arch you're building
info it worked if it ends with ok
verbose cli [ 'node', '/home/smith/.nvm/v0.4.7/bin/npm', 'link' ]
info using npm@1.0.6
info using node@v0.4.7
verbose /home/smith/.nvm/v0.4.7/bin/node node symlink
verbose config file /home/smith/.npmrc
verbose config file /home/smith/.nvm/v0.4.7/etc/npmrc
silly testEngine { name: 'gearman',
silly testEngine version: '0.3.0',
silly testEngine description: 'Client library for Gearman',
@smith
smith / npm-schema.json
Created May 13, 2011 15:33
NPM JSON Schema
{
"name": "NPM JSON Schema",
"description": "Describes a package.json for an NPM (http://npmjs.org) package. type `npm help json` for more.",
"type": "object",
"properties": {
"name": {
"type": "string",
"required": true
},
"version": {
@smith
smith / install-node-mac.sh
Created June 15, 2011 15:08
Install Node.js
#!/bin/sh
# Install Node.js on a Mac
# Requires xCode tools to be installed
# Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
# Install node
brew install node
@smith
smith / js_dom.html
Created June 24, 2011 01:43
Hacking on a plugin from Marino
<!doctype html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
@smith
smith / mx.rb
Created August 5, 2011 14:43
Read domains from a CSV and get the IP of their MX.
# Read domains from a CSV and get the IP of their MX.
require 'resolv'
require 'csv'
Resolv::DNS.open do |dns|
CSV.foreach('/Users/smith/Desktop/domains.csv') do |row|
domain = row[1]
next if domain == 'domain' # heading
mxs = dns.getresources(domain, Resolv::DNS::Resource::IN::MX)
if mxs.length == 0
@smith
smith / apps1.js
Created August 29, 2011 01:54
CloudFlare Apps JS
var _gaq = _gaq || [], vglnk = vglnk || {}, clicky_site_id = 0;
(window.__CF || window).addSequenceHandler = function() {
var a = {}, b = "", c;
window.document.onkeydown = function(d) {
c && clearTimeout(c), b += d ? d.keyCode : event.keyCode;
if (a[b])
for (var e = 0; e < a[b].length; e++)
a[b][e]();
c = setTimeout(function() {
b = ""
@smith
smith / solo.rb
Created September 9, 2011 20:58
Chef solo config
# Get the current path
dirname = File.dirname(__FILE__)
here = File.symlink?(dirname) ? File.readlink(dirname)
: File.expand_path(dirname)
cookbook_path [File.join(here, '..', 'cookbooks'),
File.join(here, '..', 'site_cookbooks')]
json_attribs File.join(here, 'solo-node.json')
@smith
smith / gist:1248874
Created September 28, 2011 18:57
Redmine Backlogs Stacktrace
ActionView::TemplateError (Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id) on line #1 of vendor/plugins/redmine_backlogs/app/views/rb_stories/_story.html.erb:
1: <li class="model story <%= mark_if_closed(story) %> <%= "tracker" + story.tracker.id.to_s%>" id="<%= story_html_id_or_empty(story) %>">
2: <div class="id story_tooltip story_field" title="<%= render :partial => "rb_stories/tooltip", :object => story %>">
3: <div class="t"><%= issue_link_or_empty(story) %></div>
4: <div class="v"><%= id_or_empty(story) %></div>
vendor/plugins/redmine_backlogs/app/views/rb_stories/_story.html.erb:1
vendor/plugins/redmine_backlogs/app/views/rb_stories/_helpers.html.erb:23
vendor/plugins/redmine_backlogs/app/views/rb_master_backlogs/show.html.erb:73
app/helpers/application_helper.rb:868:in `content_for'