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
#!/bin/bash | |
HOSTS=$(cat <<EOF | |
dev.adena.com.br | |
dev.acimaq.adena.com.br | |
EOF) | |
CMD="ls -lah /proc/\$(pidof java)/task | wc -l" | |
for H in $HOSTS |
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
file = File.new("/Users/m3nd3s/Desktop/schedule.txt", 'r') | |
begin | |
report = File.open("/Users/m3nd3s/Desktop/report.txt", 'w') | |
while(line = file.gets) | |
cols = line.split(" - ") | |
utc_time = DateTime.parse(cols[0]) | |
br_time = utc_time.in_time_zone('Brasilia') |
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
#!/bin/bash | |
set -e | |
for F in $(find . -size +900k) | |
do | |
FNAME=`basename $F` | |
mv "$F" "$F-orig" | |
echo -n "Converting ${FNAME}: " | |
convert -strip -quality 80 -resize "1024x768>" "$F-orig" "$F" | |
echo "done" |
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
#!/bin/bash | |
set -e | |
for F in $(find . -size +900k) | |
do | |
FNAME=`basename $F` | |
mv "$F" "$F-orig" | |
echo -n "Converting ${FNAME}: " | |
convert -strip -quality 80 -resize "1024x768>" "$F-orig" "$F" | |
echo "done" |
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
#config/secrets.yml | |
production: | |
secret_key_base: "173df1a20fb5d746d33695c5e22762a9fad1211d7321ad1cfa7c0ed53d540337" |
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
#/bin/bash | |
# | |
# now, you must be edit you ~/.bashrc or ~/.bash_profile and add the command: | |
# alias rm="/path/to/rm_to_from_bahia.sh" | |
# | |
# Now you're safe! | |
echo "ARE YOU SURE YOU WANT TO DELETE ALL THIS SHIT?" | |
read RESP |
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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
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
#http://dojopuzzles.com/problemas/exibe/palavras-primas/ | |
class PalavraPrima | |
attr_accessor :phrase | |
def initialize | |
@@letters =[] | |
"a".upto("z") { |l| @@letters << l } | |
"A".upto("Z") { |l| @@letters << l } | |
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
# coding: utf-8 | |
class Autor | |
attr_accessor :nomes | |
def initialize(nomes=[]) | |
@nomes = nomes | |
@nomes_especiais = ["Neto", "Filho", "Sobrinho", "Neta", "Filha", "Sobrinha", "Junior"] | |
@preposicoes = ["da", "de", "do", "das", "dos"] | |
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
# Integração com o Bundler | |
require "bundler/capistrano" | |
# Integração com RVM | |
# mais informações: http://beginrescueend.com/integration/capistrano/ | |
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path. | |
require "rvm/capistrano" | |
set :rvm_ruby_string, '1.9.2' | |
# Nome da aplicação |
OlderNewer