var myModel = new Backbone.Model({
title: "Current title",
content: "Content",
bonus: 42
});
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# if you want an icon, add it to your attributes: | |
# menu_link('Foo', '/foo/', icon: 'bar') | |
def menu_link(text, target, attributes={}) | |
# Prepend the icon, if supplied | |
if icon = attributes.delete(:icon) | |
text = "<i class='#{icon}'></i>#{text}" | |
end | |
# Build a link |
Kinesis low-force keypad — $60
- Cherry brown keyswitches
- USB hub
- Available in Mac version :)
- Mac version is white only :(
- Mac version has a comma key between 0 and period
Goldtouch USB numeric keypad — $45-65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// load n classes from the filesystem | |
if (count($argv) !== 3) { | |
throw new InvalidArgumentException('usage: php apc.php numtemplates size'); | |
} | |
$numtemplates = $argv[1]; | |
$templatesize = $argv[2]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<root> | |
<item> | |
<name>Truly Ergonomic Keyboard</name> | |
<!-- | |
DIP switch settings: | |
1 2 3 4 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
last_response.body.should match_json({ | |
user: { | |
id: :user_id, | |
username: 'chancancode', | |
full_name: 'Godfrey Chan', | |
email: 'godfrey@example.com', | |
type: 'Administrator', | |
points: Fixnum, | |
homepage: /\Ahttps?\:\/\/.*\z/i, | |
created_at: WILDCARD_MATCHER, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json_expressions' | |
RSpec::Matchers.define :match_json do |expected| | |
unless JsonExpressions::Matcher === expected | |
expected = JsonExpressions::Matcher.new(expected) | |
end | |
match do |actual| | |
actual = JSON.parse(actual) if String === actual | |
expected =~ actual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Fishfish < Formula | |
homepage 'http://ridiculousfish.com/shell' | |
url 'https://github.com/fish-shell/fish-shell.git' | |
depends_on 'autoconf' => :build | |
depends_on 'readline' | |
skip_clean 'share/doc' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!bash | |
# | |
# nanoc-completion | |
# ================ | |
# | |
# Bash completion support for nanoc | |
# | |
# | |
# Installation | |
# ------------ |