git co -b feature/59/add-filtering
git co -b bug/101/template-error
# The classics | |
class Foo | |
def bar; end | |
def self.baz; end | |
end | |
Foo.instance_method(:bar).source_location | |
Foo.method(:baz).source_location | |
# A tad more |
-- Disable Time Machine Local Backups | |
sudo tmutil disablelocal | |
-- Disable Automatic Spell Checker | |
defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false | |
-- Disable animations when opening and closing windows. | |
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false | |
-- Disable animations when opening a Quick Look window. | |
defaults write -g QLPanelAnimationDuration -float 0 | |
-- Accelerated playback when adjusting the window size (Cocoa applications). | |
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001 |
run_with_tco = ARGV.include?('-TCO') | |
# Force the ruby interpreter to use TCO | |
RubyVM::InstructionSequence.compile_option = { | |
tailcall_optimization: true, | |
trace_instruction: false | |
} if run_with_tco | |
puts 'To infinity and beyond!' if run_with_tco |
# Definition of banning something | |
# to_ban = 'To prohibit (an action) or forbid the use of (something)' | |
EVERYTHING = -> (existing_bans) { def existing_bans.include?(obj); true; end } | |
@bans = [] | |
ban_something = -> (how_to_ban) { how_to_ban.call(@bans) } | |
# Some simple tests |
This can be fixed via:
But it breaks an important OS X function.
require 'benchmark' | |
include Benchmark | |
n = 500000 | |
Benchmark.benchmark(CAPTION, 20, FORMAT, ">total:", ">avg:") do |x| | |
x.report('via usual syntactics') { n.times { class MyError < StandardError ; end && Object.send(:remove_const, 'MyError') } } | |
x.report('via Class.new') { n.times { MyError = Class.new(StandardError) && Object.send(:remove_const, 'MyError') } } | |
end | |
# Results |
disclaimer:
ruby patch-edid.rb
=> will generate a directory similar to DisplayVendorID-15c3
#!/bin/bash -ex | |
### More info: https://coderwall.com/p/a56j3w/memory-efficient-ubuntu-vms | |
### configuration | |
PKGS_TO_ADD="$PKGS_TO_ADD curl git etckeeper python-software-properties" | |
PKGS_TO_REMOVE="$PKGS_TO_REMOVE geoip-database popularity-contest" | |
PKGS_TO_REMOVE="$PKGS_TO_REMOVE pppoeconf pppconfig ppp" | |
PKGS_TO_REMOVE="$PKGS_TO_REMOVE ubuntu-standard memtest86+" # warning: be careful about what you remove after this |
How to install UnixBench on Mavericks:
$ wget https://byte-unixbench.googlecode.com/files/UnixBench5.1.3.tgz
$ tar xzvf UnixBench5.1.3.tgz
$ git clone https://gist.github.com/11033924.git
$ cd UnixBench
$ patch -p1 < ../11033924/UnixBench5.1.3.mavericks.patch
$ make
$ ./Run