Skip to content

Instantly share code, notes, and snippets.

View caironoleto's full-sized avatar
🎯
Focusing

Cairo Noleto caironoleto

🎯
Focusing
View GitHub Profile
#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
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
@caironoleto
caironoleto / tuning-primer.sh
Created December 18, 2009 13:08
MySQL Tuning Primer
#!/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 #
# #
#!/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
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
it "should redirect to login path without authenticated" do
get :index
response.should redirect_to(new_user_session_url)
end
#<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,
#!/usr/bin/env ruby
puts "<pre>#{%x[rake routes]}</pre>"
#! /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
server {
listen 80;
server_name localhost;
root /var/www/aplicacao
passenger_enabled on;
}