Some random notes on the pangs of ember. Will be expanding as they are uncovered.
Say you have a form that maps to a model, something like:
<form>
<fieldset>
<legend>Who are you?</legend>| segmentLengthBound = ... // B, originally set to s.length/2 | |
| counter = {} // o | |
| bestSavings = 0 // M | |
| maxRepetitions = 0 // N | |
| bestSegment = 0 // e | |
| longestSegmentLength = 0 // Z | |
| segmentLength = 0 // t | |
| while (segmentLength <= segmentLengthBound) { | |
| start = 1; |
| #!/usr/bin/env ruby | |
| # Note, this must be run as root, and is super dangerous. | |
| # You should not use it. It was written in about 75 minutes total. | |
| # Copyright (c) 2012 Tod Beardsley | |
| # Licensed under the Ruby license. | |
| require 'packetfu' | |
| require 'net/dns' |
| # url.coffee | |
| # by Aseem Kishore ( https://github.com/aseemk ), under MIT license | |
| # | |
| # A simplified wrapper around the native 'url' module that returns "live" | |
| # objects: updates to properties are reflected in related properties. E.g. | |
| # updates to the `port` property will be reflected on the `host` property. | |
| # | |
| # The public API and behavior are pretty close to the native 'url' module's: | |
| # http://nodejs.org/docs/latest/api/url.html Currently lacking / known issues: | |
| # |
| # FM Synthesis code I wrote whole dorking out with | |
| # https://github.com/awwaiid/ruby-noise | |
| # first, lets define some variables we can use | |
| harmonic_ratio = 1.5 # overtones involving the perfect 5th | |
| #harmonic_ratio = 1.33 # overtones involving the perfect 4th | |
| #harmonic_ratio = 1.25 # overtones involving the major 3rd | |
| #harmonic_ratio = 1.2 # overtones involving the minor 3rd | |
| # harmonic ratios close to these values introduce a wobble | |
| # characteristic of analog synthesizers. Diverge much |
| # Usage: redis-cli publish message hello | |
| require 'sinatra' | |
| require 'redis' | |
| conns = [] | |
| get '/' do | |
| erb :index | |
| end |
| # Usage: redis-cli publish message.achannel hello | |
| require 'sinatra' | |
| require 'redis' | |
| conns = Hash.new {|h, k| h[k] = [] } | |
| Thread.abort_on_exception = true | |
| get '/' do |
| #!/bin/sh | |
| if git rev-parse --verify HEAD >/dev/null 2>&1 ; then | |
| against=HEAD | |
| else | |
| # Initial commit: diff against an empty tree object | |
| against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
| fi | |
| # Find files with trailing whitespace |
| /** | |
| * Create a web friendly URL slug from a string. | |
| * | |
| * Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support. | |
| * | |
| * Although supported, transliteration is discouraged because | |
| * 1) most web browsers support UTF-8 characters in URLs | |
| * 2) transliteration causes a loss of information | |
| * | |
| * @author Sean Murphy <sean@iamseanmurphy.com> |
Custom recipe to get OS X 10.9 Mavericks running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install.
The software selected is software that is "tried and true" --- software I need after any fresh install. I often install other software not listed here, but is handled in a case-by-case basis.