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
#raffle numbers for the mega sena | |
@nums = [] | |
def avoid_repeating(current) | |
if @nums.include?(current) == true or current == 0 | |
avoid_repeating(rand(61)) | |
else | |
@nums << current | |
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
def auth | |
user = `/usr/local/git/bin/git config --global github.user`.strip | |
token = `/usr/local/git/bin/git config --global github.token`.strip | |
user.empty? ? {} : { 'login' => user, 'token' => token } | |
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
#!/usr/bin/env bash | |
######################################################################### | |
# # | |
# MySQL performance tuning primer script # | |
# Writen by: Matthew Montgomery <[email protected]> # | |
# Inspired by: MySQLARd (http://gert.sos.be/demo/mysqlar/) # | |
# Version 1.2-r6 # | |
# Licenced under GPLv2 # | |
# # |
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
#!/bin/bash | |
read -p "Type your domain: " domain | |
apt-get install postfix postfix-tls libsasl2-2 sasl2-bin libsasl2-modules telnet | |
cp /etc/postfix/sasl/smtpd.conf /etc/postfix/sasl/smtpd.conf.backup | |
echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf | |
echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf |
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
describe PostController | |
describe "GET index" do | |
it "should redirect to login path without authenticated" do | |
get :index | |
response.should redirect_to(new_user_session_url) | |
end | |
end | |
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
it "should redirect to login path without authenticated" do | |
get :index | |
response.should redirect_to(new_user_session_url) | |
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
#<YouTubeG::Model::Video:0x22546c4 | |
@media_content=[#<YouTubeG::Model::Content:0x2291510 | |
@default=true, | |
@format=#<YouTubeG::Model::Video::Format:0x20399c0 | |
@format_code=5, | |
@name=:swf>, | |
@url="http://www.youtube.com/v/fkuYr9xBFB0?f=videos&app=youtube_gdata", | |
@duration=53, | |
@mime_type="application/x-shockwave-flash">, #<YouTubeG::Model::Content:0x2291038 | |
@default=false, |
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
#!/usr/bin/env ruby | |
puts "<pre>#{%x[rake routes]}</pre>" |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
server { | |
listen 80; | |
server_name localhost; | |
root /var/www/aplicacao | |
passenger_enabled on; | |
} |