(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
# based on http://www.natontesting.com/2010/01/11/updated-script-to-list-all-cucumber-step-definitions/ | |
# | |
desc 'List all defined steps' | |
task :steps do | |
require 'hirb' | |
extend Hirb::Console | |
puts "CUCUMBER steps:" | |
puts "" | |
step_definition_dir = "features/step_definitions" |
<!DOCTYPE html> | |
<html<?php print $html_attributes; ?>> | |
<head> | |
<?php print $head; ?> | |
<title><?php print $head_title; ?></title> | |
<?php print $styles; ?> | |
<?php print $head_scripts; ?> | |
</head> | |
<body<?php print $body_attributes;?>> |
Made an update covering Macos 10.8 and ruby 2.0: https://gist.github.com/michaelsd/5224456 | |
- Install "Command Line Tools for XCode" (Get it from Apple Developer Program) or Install XCode via Appstore | |
where option one is the faster one, 170MB vs 1.xGB | |
- Install https://github.com/sstephenson/rbenv | |
git clone into your home folder; | |
set environment variables, see install docs of rbenv; | |
- Get libyaml |
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
#!/bin/sh | |
# 404-check.sh - Script to test for 404s | |
# author: lkptrzk | |
# Usage: | |
# Assuming a file named 'input' with one URL per line | |
# the following command will output which files were 404s: | |
# cat input | xargs 404-check.sh |
#add this to your gemfile | |
gem 'mongoid' | |
gem 'devise' | |
gem "omniauth-facebook" |
var App = angular.module('App', []); | |
App.controller('TodoCtrl', function($scope, $http) { | |
$http.get('todos.json') | |
.then(function(res){ | |
$scope.todos = res.data; | |
}); | |
}); |
This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)
The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array
it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array
part of it away. So how does that work?
The key here is that objects usually have a predefined set of keys, whereas arrays don't:
class MyApp < Scorched::Controller | |
render_defaults.merge!( | |
engine: :haml, | |
layout: :index | |
) | |
#redirect after a 404 error | |
after status:404 do | |
redirect('/') | |
end | |
middleware << proc { |