Couldn't find the text of this for a while...
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
/* | |
Fill in the body of the `debounce` function, such that running | |
the following code will output "fn was called with 10!" only once. | |
*/ | |
(function () { | |
var debounce, fn, i; | |
debounce = function (func, wait) { | |
// ... | |
}; |
function beget(parent, child) { | |
// Add code here to make test() return true. | |
} | |
function test(){ | |
var c; | |
function Parent() { | |
throw 'exception'; | |
} |
This is a local copy of the commands from:
- http://www.jmknoble.net/keys/#master-key
- http://www.macfreek.nl/mindmaster/Convert_GPG_keys_to_subkeys
- http://wiki.fsfe.org/Card_howtos/Card_with_subkeys_using_backups/
This guide serves as a reference of collected information necessary for strict management of PGP keys. This includes keeping a master key that always remains
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
function beget(parent, child){ | |
// put code here to make test() return true | |
}; | |
function test(){ | |
function Parent(){ | |
throw 'exception'; | |
}; | |
Parent.prototype = {code: Math.random()}; |
require 'test/unit' | |
class Whale | |
def self.attr_validated(method_name, &validation) | |
# Enter code here to make all tests pass. | |
end | |
attr_validated :num_teeth do |v| | |
v <= 4 | |
end |
generate | |
rails plugin new importable --dummy-path=spec/dummy --full --mountable -T | |
add to gemspec | |
s.add_dependency 'jquery-rails' | |
s.add_dependency 'sass-rails' | |
s.add_dependency 'bootstrap-sass', '~> 2.0.3' |
require 'rubygems' | |
require 'chef/encrypted_data_bag_item' | |
secret = Chef::EncryptedDataBagItem.load_secret('data_bag_key') | |
data = {"id" => "mysql", "root" => "some secret password"} | |
encrypted_data = Chef::EncryptedDataBagItem.encrypt_data_bag_item(data, secret) | |
FileUtils.mkpath('data_bags/passwords') | |
File.open('data_bags/passwords/mysql.json', 'w') do |f| | |
f.print encrypted_data.to_json |