Makes 170g dough (enough for one 30 cm pizza)
- 1 teaspoon dried yeast
- 1 teaspoon salt
- 100 ml warm water
- 2 teaspoons olive oil, plus extra, for greasing
- 160 g plain (all-purpose) flour, sifted
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |
Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.
Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.
First you will need to get an OAuth Token from GitHub using your own username and "note"
if ENV["RSPEC_REPORT_EXCEPTIONS"] | |
class Exception | |
alias_method :old_initialize, :initialize | |
def self.exceptions_seen | |
@@seen ||= {} | |
end | |
def self.see args | |
stack = caller[1..-1] |
# MAC manipulators | |
alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`' | |
alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE' |
# Set up the application | |
app = angular.module('ratingRampage', []) | |
# This is an injectable property | |
app.value 'Authentication', {} | |
# Add a directive so that if we see a csrf-token attribute, this gets set | |
app.directive 'csrfToken', (Authentication) -> | |
(scope, element, attrs) -> | |
Authentication.csrf_token = attrs.csrfToken |
#!/usr/bin/env ruby | |
spec_hits = [] | |
checks = { | |
'_spec\.rb$' => ['focus:[:space:]*true'], | |
'\.rb$' => ['binding\.pry', 'debugger'] | |
} | |
# Find the names of all the filenames that have been (A)dded (C)opied or (M)odified | |
filenames = `git diff --cached --name-only --diff-filter=ACM`.split("\n") |
record = Post.new(:title => 'Yay', :body => 'This is some insert SQL') | |
# easiest way to achieve this is by calling protected #arel_attributes_values (tested in | |
# rails 3.2.13). the alternative is to build the entire insert statement using arel >_> | |
record.class.arel_table.create_insert \ | |
.tap { |im| im.insert(record.send(:arel_attributes_values, false)) } \ | |
.to_sql |
# A simple Makefile alternative to using Grunt for your static asset compilation | |
# | |
## Usage | |
# | |
# $ npm install | |
# | |
# And then you can run various commands: | |
# | |
# $ make # compile files that need compiling | |
# $ make clean all # remove target files and recompile from scratch |