Skip to content

Instantly share code, notes, and snippets.

@outoftime
outoftime / start_passenger
Created September 25, 2014 19:22
Passenger standalone with debugger and pry
#!/usr/bin/env ruby
require 'bundler'
Bundler.setup(:default, :development)
require 'rack-debug/debugger'
require 'pry-remote'
system('rm', '-fv', 'tmp/rack-debug.*')
fork { exec 'bundle', 'exec', 'passenger', 'start' }
@outoftime
outoftime / dotmatrix_cheat_sheet.md
Last active August 29, 2015 14:07
Dotmatrix cheat sheet

Command line

General-purpose

hcd DIR Go to DIR in your $HASHROCKET_DIR
ll List contents of directory in long format
@outoftime
outoftime / hackbone.js
Last active August 29, 2015 14:08
Hackbone sketch
window.Hackbone = (function () {
var hackbone, setupEvents;
hackbone = {
extend: function (prototype) {
var view = Backbone.View.extend(prototype),
selector = view.prototype.el;
if (typeof selector !== 'undefined') {
class Post
include Cequel::Record
belongs_to :blog
key :id, :timeuuid, auto: true
column :author_id, :timeuuid
# other column definitions
def author
@author ||= User.find(author_id)
require 'active_support/all'
class FakeRegexp
def initialize(pattern)
@pattern = pattern
end
def matches?(str)
case
when pattern.empty?
http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu48_4.8.1.1-3ubuntu0.5_amd64.deb
http://mirrors.kernel.org/ubuntu/pool/main/i/icu/libicu-dev_4.8.1.1-3ubuntu0.5_amd64.deb
<!DOCTYPE html>
<html>
<head>
<title>ScriptEd Unit 10 Project: Facebook wall</title>
</head>
<body>
<div class="container">
<h1>ScriptEd Unit 10 Project: Facebook wall</h1>
<hr/>
@outoftime
outoftime / plus
Created May 21, 2015 16:10
Addressable::URI#+
>> base = Addressable::URI.parse('http://example.com/one/two')
=> #<Addressable::URI:0x8add0da8 URI:http://example.com/one/two>
>> base + 'some/path'
=> #<Addressable::URI:0x8adcc910 URI:http://example.com/one/some/path>
>> base + '/some/path'
=> #<Addressable::URI:0x8adcaafc URI:http://example.com/some/path>
>> base + 'http://different.domain.com/some/path'
=> #<Addressable::URI:0x8adbe16c URI:http://different.domain.com/some/path>
@outoftime
outoftime / genius_call_to_action.html
Created August 6, 2015 21:56
Genius call to action
<genius-callout>
<genius-callout-intro>
Want to add your own comment?
</genius-callout-intro>
<genius-callout-highlight>
Highlight text
</genius-callout-highlight>
and click
<genius-callout-prompt></genius-callout-prompt>
to annotate using
<genius-callout>To see an annotation, click or tap the <genius-callout-highlight>highlighted part</genius-callout-highlight> of the transcript; if you would like to leave your own annotations, make sure you have a <a href="http://genius.com/">Genius account</a>. Post staff annotations will appear by default; others are in a menu that you can see in the upper right when you click or tap on an annotation.</genius-callout>