- Rails For Zombies: Rails course
- Ruby Monk: Interactive ruby tutorials
- Ruby Koans: More interactive ruby tutorials
- Rails Casts: Rails video tutorials
- Ruby Bookmarks: A good list of ruby links
- Awesome Ruby: Another list of links
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
def lugar_vazio(bathroom): | |
pmetade=bathroom[:len(bathroom)/2] | |
smetade=bathroom[len(bathroom)/2:] | |
if bathroom[0]==0: | |
return 0 | |
elif bathroom[-1]==0: | |
return len(bathroom)-1 | |
elif bathroom[(len(bathroom)-1)/2]==0: | |
return (len(bathroom)-1)/2 | |
else: |
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
From bd9e9c08082419828098ee7b327448725d1455ca Mon Sep 17 00:00:00 2001 | |
From: Lucas Zawacki <lfzawacki@gmail.com> | |
Date: Wed, 11 Jul 2012 14:24:04 -0300 | |
Subject: joy.cpl: Correct joystick testing thread behavior (try 2) | |
The problem with the original behavior is that it starts a new thread each time the test tab is switched to, but | |
only stopped them on PSN_RESET. Now when the window receives PSN_KILLACTIVE (cancel button, X button or tab switch) or | |
PSN_RESET (ok button), the thread will rightfully die. | |
--- |
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
From d035e950c47861a94215a2508ef5f27247b89c0e Mon Sep 17 00:00:00 2001 | |
From: Lucas Zawacki <lfzawacki@gmail.com> | |
Date: Mon, 18 Jun 2012 14:48:50 -0300 | |
Subject: [PATCH] dinput: Append driver name to dinput joysticks on Linux | |
--- | |
dlls/dinput/joystick_linux.c | 7 ++++++- | |
dlls/dinput/joystick_linuxinput.c | 15 ++++++++++----- | |
2 files changed, 16 insertions(+), 6 deletions(-) |
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
In a new Ubuntu Trusty lxc-container: | |
sudo lxc-create -t ubuntu -n bbb-html5 -- -r trusty | |
Install BBB090: https://code.google.com/p/bigbluebutton/wiki/090InstallationUbuntu | |
Install development stuff: https://code.google.com/p/bigbluebutton/wiki/090Developing | |
Install nodejs |
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
// Buzzer example function for the CEM-1203 buzzer (Sparkfun's part #COM-07950). | |
// by Rob Faludi | |
// http://www.faludi.com | |
// Matehacked by Lucas and Jerônimo | |
int noteToFreq(int note) | |
{ | |
return (int) pow(2, (double)note/12) * 440; | |
} |
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
<?php | |
$sql0 = mysql_query("SELECT DISTINCT nomecliente FROM andamento ORDER BY nomecliente") or die ("Erro: ".mysql_error()); | |
$list_options = ""; | |
while ($aux0 = mysql_fetch_array($sql0)) { | |
$nome = $aux0["nomecliente"]; | |
/* Cria uma string com as options de todos clientes, coloca um depois do outro */ | |
$list_options .= "<option value='$nome'>$nome</option>\n"; | |
/* Fica tipo | |
<option value='lucas'>lucas</option> |
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
#!/usr/bin/ruby | |
require 'open-uri' | |
def classy_exit | |
puts "I need a youtube video URL" | |
exit 0 | |
end | |
def get_video_id url |
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
#/usr/bin/ruby | |
require 'open-uri' | |
require 'nokogiri' | |
links = IO.read('links.txt').split("\n") | |
links.each do |link| | |
f = open(link) | |
doc = Nokogiri::HTML(f) |
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
def warn_and_exit | |
puts "Prints to stdout a describe block for each method in the model file." | |
puts "\tusage \"#{__FILE__}\" [MODEL_FILE]" | |
exit 0 | |
end | |
warn_and_exit if ARGV.size != 1 | |
content = IO.read(ARGV[0]) |