- Twitter: @filipebarcos
- Github: @filipebarcos
- Website or Blog: http://about.me/filipebarcos
- Company: Stack Builders Inc. http://stackbuilders.com
[Feel free to add more details if you wish…]
[Feel free to add more details if you wish…]
module ClassMethods | |
def self.method2 | |
end | |
end | |
module InstanceMethods | |
def method1 | |
end | |
end |
require 'benchmark' | |
n = 1000000 | |
Benchmark.bm(15) do |x| | |
x.report("assign single") { n.times do; c = 'a string'; end} | |
x.report("assign double") { n.times do; c = "a string"; end} | |
x.report("concat single") { n.times do; 'a string ' + 'b string'; end} | |
x.report("concat double") { n.times do; "a string " + "b string"; end} | |
end |
Please edit your Apache configuration file, and add these lines: | |
LoadModule passenger_module /home/ubuntu/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.57/buildout/apache2/mod_passenger.so | |
<IfModule mod_passenger.c> | |
PassengerRoot /home/ubuntu/.rvm/gems/ruby-2.1.1/gems/passenger-4.0.57 | |
PassengerDefaultRuby /home/ubuntu/.rvm/gems/ruby-2.1.1/wrappers/ruby | |
</IfModule> | |
After you restart Apache, you are ready to deploy any number of web | |
applications on Apache, with a minimum amount of configuration! |
require 'benchmark/ips' | |
Benchmark.ips do |x| | |
x.report("with lazy") do | |
(1..1_000_000).lazy | |
.select(&:odd?) | |
.map(&:to_s) | |
.take(1000) | |
end |
#! /usr/bin/env bash | |
sudo -u postgres /Library/PostgreSQL/9.1/bin/pg_ctl start -D /Library/PostgreSQL/9.1/data |
#! /usr/bin/env bash | |
sudo -u postgres /Library/PostgreSQL/9.1/bin/pg_ctl stop -D /Library/PostgreSQL/9.1/data -m fast |
#export | |
export EC2_HOME=$HOME/.ec2/ec2-api-tools | |
export MAVEN_HOME=$HOME/Desenvolvimento/apache-maven-3.0.3/ | |
export RUBY_HOME=/usr/local/Cellar/ruby/1.9.3-p125 | |
export PATH=$MAVEN_HOME/bin:$JAVA_HOME/bin:/usr/local/mysql/bin:$RUBY_HOME/bin:$EC2_HOME/bin:$PATH | |
export GREP_OPTIONS="--color=auto" | |
export GREP_COLOR="4;33" | |
export CLICOLOR="auto" | |
export PS1='\n[\u] \[\033[1;33m\]\w\[\033[0m\] \[\033[1;32m\]$(__git_ps1)\[\033[0m\] \n\$ ' |
If you use VIM you are like me, uses VIM as IDE, this workflow can be useful for you. I create an workflow using Automator to open the selected folder on Finder to be opened using VIM.
$.each($('input:checkbox'), function(key, elem) { | |
$(elem).attr('checked', 'checked'); | |
}); |