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
upstream project { | |
server unix:///var/tmp/project.sock; | |
} | |
server { | |
listen 80; | |
server_name localhost; | |
root /var/www/project/current/public; | |
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
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
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
description "nginx webserver" | |
start on startup | |
stop on shutdown | |
respawn | |
expect fork | |
exec /opt/nginx/sbin/nginx |
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
# https://github.com/sstephenson/rbenv | |
# | |
# I'm using rbenv-build to install ruby | |
# https://github.com/sstephenson/ruby-build | |
cd ~/.rbenv/ | |
git pull | |
cd plugins/ruby-build/ | |
git pull | |
rbenv install 2.0.0-p0 |
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
#include <stdio.h> | |
#define LIMITE 50 | |
int main(void) | |
{ | |
int A=0, B=0, C=0, soma; | |
printf("Digite um número inteiro: \n"); | |
scanf("%d", &A); |
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
$ rake db:create | |
WARNING: 'require 'rake/rdoctask'' is deprecated. Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead. | |
at /Users/jtadeulopes/.rvm/gems/ruby-1.8.7-p370@global/gems/rake-0.9.2.2/lib/rake/rdoctask.rb | |
dyld: lazy symbol binding failed: Symbol not found: _mysql_init | |
Referenced from: /Users/jtadeulopes/.rvm/gems/ruby-1.8.7-p370/gems/mysql-2.8.1/lib/mysql_api.bundle | |
Expected in: flat namespace | |
dyld: Symbol not found: _mysql_init | |
Referenced from: /Users/jtadeulopes/.rvm/gems/ruby-1.8.7-p370/gems/mysql-2.8.1/lib/mysql_api.bundle | |
Expected in: flat namespace |
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
$ ruby -v | |
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin10.8.0] | |
$ rake stats | |
Code LOC: 1969 Test LOC: 3407 Code to Test Ratio: 1:1.7 | |
$ time bundle exec rails runner "puts 'hello'" | |
rails real user sys | |
3.0.11 12.087 7.673 2.236 |
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
# encoding: utf-8 | |
require "tire" | |
users = [ | |
{ :id => '1', :type => 'user', :name => 'Jesus Lopes', :email => 'jl@zigotto.com' }, | |
{ :id => '2', :type => 'user', :name => 'Alfredo', :email => 'alfredo@email.com' }, | |
{ :id => '3', :type => 'user', :name => 'Éder Costa', :email => 'ec@zigotto.com' } | |
] | |
Tire.index("users") do |
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
it "should always update permalink" do | |
model.permalink :title, :always_update => true | |
record = model.create(:title => "Some nice post", :permalink => " ") | |
record.permalink.should == "some-nice-post" | |
record.title = "another title" | |
record.save | |
record.permalink.should == "another-title" |
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
# | |
# Deve completar a máscara de acordo com o número informado | |
# | |
mask("125") | |
=> "00012-500" | |
mask("385002") | |
=> "38500-200" |