This file contains hidden or 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
*Instalando o devise | |
*Colocando custom fields para o devise | |
*Gerando custom views | |
*Editar quantidade minima para tamanho da senha | |
*Não permitindo usuário acessar o controller se não estiver logado | |
*Depois de se cadastrar não logar automaticamente | |
# Application.html.erb |
This file contains hidden or 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
# Atualizar o sistema | |
sudo apt-get update | |
# Instale o cú rl ( haha ) | |
sudo apt-get install curl | |
# Agora vai a rvm :) | |
curl -L https://get.rvm.io | bash -s stable |
This file contains hidden or 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
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
# NEW WAY / EASY WAY | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.deb | |
sudo dpkg -i elasticsearch-1.4.2.deb |
This file contains hidden or 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
#ecoding: utf-8 | |
require 'mechanize' | |
10.times do |i| | |
begin | |
value = 114980 + i | |
agent = Mechanize.new.get("http://trampos.co/oportunidade/#{value}") | |
agent.title #Titulo da vaga | |
empresa = agent.search(".heading-2").map(&:text)[0] | |
local_vaga = agent.search(".f4").map(&:text)[2] |
This file contains hidden or 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
Rodar webbrick em todas as pastas da sua maquina ;) | |
ruby -run -ehttpd . -p8000 | |
#processador de imagens => sudo apt-get install imagemagick | |
#mysql2 need => sudo apt-get install libmysql-ruby libmysqlclient-dev | |
#MYSQL SERVER => sudo apt-get install mysql-server | |
#Nood js => sudo apt-get install nodejs | |
#Lib Java Runtime => sudo apt-get install libv8-dev | |
This file contains hidden or 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 'mechanize' | |
agent = Mechanize.new.get("http://www.mepergunte.com/index_novas_respostas.php") | |
total = agent.links.count | |
total.times do |i| | |
puts agent.links[i].href | |
agent2 = Mechanize.new.get("http://www.mepergunte.com/"+ agent.links[i].href ) | |
agent2.links.count.times do |j| | |
a = agent2.links[j].href.to_s && j | |
t = a[0].scan('http://mepergunte.s3.amazonaws.com/usuarios/') | |
puts t if t != [] |
This file contains hidden or 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
# Acessar o usuário | |
https://api.instagram.com/v1/users/489110643/media/recent?client_id=df78ad1c73eb4cf88247732ca3aa7f2c | |
#Buscar usuário ;) | |
https://api.instagram.com/v1/users/search?q=neymarjr&access_token=17992263.f59def8.9ac9b1030f614ae6877508043ba89af6 | |
#Seguindo os usuários | |
https://api.instagram.com/v1/users/333/follows?client_id=df78ad1c73eb4cf88247732ca3aa7f2c# | |
https://api.instagram.com/v1/tags/barkbox?access_token=17992263.f59def8.9ac9b1030f614ae6877508043ba89af6 |
This file contains hidden or 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
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}' |
This file contains hidden or 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
<?php | |
// sudo apt-get install vnstat | |
// sudo vnstat -u -i eth0 | |
// sudo vnstat -i eth0 | |
$results = shell_exec("vnstat -m --oneline"); | |
$resultsArray = explode("\n", trim($results)); | |
$servidorArray = explode(";", $resultsArray[0]); | |
$data = $servidorArray[2]; |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
OlderNewer