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
''' | |
Copyright (c) 2011, Richard Nienaber | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
The name of 'Richard Nienaber' may not be used to endorse or promote products derived from this software without specific prior written permission. |
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 'stopwatch' | |
class Dummy | |
extend MethodDecorators | |
+Stopwatch | |
def test | |
sleep(0.1) | |
end |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\]$ " |
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 'sinatra' | |
before do | |
puts "PARAMS: #{params.inspect}" #PARAMS: {} | |
end | |
get '/hi/:greeting' do | |
puts "PARAMS: #{params.inspect}" #PARAMS: {"splat"=>[], "captures"=>["Hello"], "greeting"=>"Hello"} | |
"#{params[:greeting]} World!" | |
end |
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 'aspector' | |
require 'benchmark' | |
ITERATIONS = 100_000 | |
class MyProcessor | |
def test_one | |
1 + 1 | |
end | |
end |
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 'rubygems' | |
require 'benchmark' | |
require 'aquarium' | |
ITERATIONS = 100_000 | |
class MyProcessor | |
def test_one | |
1 + 1 | |
end |
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
$ pypy-2.1/bin/pypy --version | |
Python 2.7.3 (480845e6b1dd, Jul 31 2013, 09:57:07) | |
[PyPy 2.1.0 with GCC 4.6.3] | |
$ pypy3-2.1-beta1-linux64/bin/pypy --version | |
Python 3.2.3 (d63636b30cc0, Jul 30 2013, 07:02:17) | |
[PyPy 2.1.0-beta1 with GCC 4.6.3] | |
~/projects/pypy-2.1/bin/pypy perf.py --fast -b 2n3,threading,-fastunpickle,-fastpickle ~/projects/pypy-2.1/bin/pypy ~/projects/pypy3-2.1-beta1-linux64/bin/pypy > ~/projects/results.txt |
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
/* Define on Darwin to activate all library features */ | |
#define _DARWIN_C_SOURCE 1 | |
/* This must be set to 64 on some systems to enable large file support. */ | |
#define _FILE_OFFSET_BITS 64 | |
/* Define on Linux to activate all library features */ | |
#define _GNU_SOURCE 1 | |
/* This must be defined on some systems to enable large file support. */ | |
#define _LARGEFILE_SOURCE 1 | |
/* Define on NetBSD to activate all library features */ |
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
(vagrant-setup)$ vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: Checking if box 'ubuntu/trusty64' is up to date... | |
==> default: Clearing any previously set forwarded ports... | |
==> default: Clearing any previously set network interfaces... | |
==> default: Preparing network interfaces based on configuration... | |
default: Adapter 1: nat | |
default: Adapter 2: hostonly | |
==> default: Forwarding ports... | |
default: 8080 => 28080 (adapter 1) |
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
$ vagrant up | |
Bringing machine 'default' up with 'virtualbox' provider... | |
==> default: Box 'ubuntu/trusty64' could not be found. Attempting to find and install... | |
default: Box Provider: virtualbox | |
default: Box Version: >= 0 | |
==> default: Loading metadata for box 'ubuntu/trusty64' | |
default: URL: https://vagrantcloud.com/ubuntu/trusty64 | |
==> default: Adding box 'ubuntu/trusty64' (v14.04) for provider: virtualbox | |
default: Downloading: https://vagrantcloud.com/ubuntu/trusty64/version/1/provider/virtualbox.box | |
==> default: Successfully added box 'ubuntu/trusty64' (v14.04) for 'virtualbox'! |
OlderNewer