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
class Password < String | |
POSSIBLE_STRENGTHS = { 1 => "senha fraca", 2 => "senha média", 3 => "senha forte" } | |
def self.check_strength(password) | |
strength = 1 | |
if password.length >= 8 || (password.length > 6 && password =~ /[a-z]/ && password =~ /[0-9]/) | |
strength+=1 | |
end | |
if password.length > 12 && password =~ /[a-z]/ && password =~ /[A-Z]/ && password =~ /[0-9]/ && password =~ /[^a-zA-Z0-9_\s]/ |
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
# THIS SNIPPET OPEN A LOG FILE THEN | |
# SEARCH FOR YOUTUBE LINKS AND GET ALL VIDEO TITLES. | |
require 'rubygems' | |
require 'hpricot' | |
require 'fileutils' | |
require 'open-uri' | |
youtube_xml_url = "http://gdata.youtube.com/feeds/api/videos/" | |
youtube_url = "http://youtube.com/watch?v=" |
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
function content_changer(container,wrapper, baseHeight = 0) { | |
var newHash = "", | |
$mainContent = container, | |
$pageWrap = wrapper, | |
baseHeight, | |
$el; | |
$pageWrap.height($pageWrap.height()); | |
baseHeight = $pageWrap.height() - $mainContent.height(); |
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
function content_changer(container,wrapper, nav_id, baseHeight = 0) { | |
var newHash = "", | |
$mainContent = container, | |
$pageWrap = wrapper, | |
baseHeight, | |
$el; | |
$pageWrap.height($pageWrap.height()); | |
baseHeight = $pageWrap.height() - $mainContent.height(); |
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
check process resque-web with pidfile /var/www/app/shared/resque_web/resque_web.pid | |
group resque | |
start program = "/bin/env RAILS_ENV=production /var/www/app/current/app/workers/run_resque_web.sh start" as uid deploy gid deploy | |
stop program = "/bin/env RAILS_ENV=production /var/www/app/current/app/workers/run_resque_web.sh stop" as uid deploy and gid deploy | |
if failed host localhost port 5678 with timeout 10 seconds then restart | |
if 3 restarts within 5 cycles then timeout |
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
Setalabs Contrata estagiário em desenvolvimento web. | |
Somos uma Startup goiana especializada em desenvolvimento de aplicativos web. Temos um ambiente agradável e salário compatível com o mercado. Atualmente trabalhamos com ruby on rails em todos nossos produtos. Estamos a procura de uma pessoa que tenha facilidade de aprender tecnologias novas. | |
Requisitos: | |
- OO | |
- HTML/CSS fluente | |
- Javascript | |
- Ruby(ou que tenha experiência em alguma linguagem de programção OO) | |
- Rails 2 e 3 | |
- Tenha conhecimento em banco de dados(modelagem, consultas simples) |
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
class A | |
attr_accessor :name | |
@@a_classes = [] | |
private_class_method :new | |
def A.find_or_create(name) | |
@@a_classes.each do |klass| | |
if klass.name == name | |
return klass | |
end |
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
# Tip for use ctrl + c and ctrl + v on gnome-terminal' | |
$ gconftool-2 -t str -s /apps/gnome-terminal/keybindings/copy "<Control>c" | |
$ gconftool-2 -t str -s /apps/gnome-terminal/keybindings/paste "<Control>v" |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int main() { | |
// inicializacao das variavieis | |
char string[100]; | |
char numero_char[6]; | |
int numero = 0; | |
int i = 0; // utilizado para andar pela string digitada pelo usuario | |
int j = 0; // utilizado para andar pelo numero capturado dentro da string |
OlderNewer