Problema: http://dojopuzzles.com/problemas/exibe/nomes-de-autores-de-obras-bibliograficas/
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
git config --global user.name "Bruno Tavares" | |
git config --global alias.s "status -sb" | |
git config --global alias.ci commit | |
git config --global alias.co checkout | |
git config --global alias.l log | |
git config --global alias.graph "log --graph --decorate --oneline --branches" | |
git config --global alias.df "diff --cached --color-words" | |
git config --global alias.dff "diff --color-words" | |
git config --global color.ui always | |
git config --global core.excludesfile ~/.gitignore_global |
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
import Data.List | |
import Data.Tree | |
data Operator = Plus | Minus | Times | By | None deriving (Eq) | |
instance Show Operator where | |
show Plus = "+" | |
show Minus = "-" | |
show Times = "*" | |
show By = "/" | |
show None = "Initial" |
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
import Data.List | |
longestSubset xs = last $ sortBy summing $ subsets xs | |
where subsets = concatMap inits . tails | |
summing x y = sum x `compare` sum y | |
main = do | |
let arry = [(-2), 1, (-3), 4, (-1), 2, 1, (-5), 4] | |
print $ longestSubset arry |
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
import Data.Bits | |
mySum :: Int -> Int -> Int | |
mySum a b | |
|carry == 0 = result | |
|otherwise = mySum result $ shift carry 1 | |
where carry = (.&.) a b | |
result = xor a b | |
mySubtraction :: Int -> Int -> Int |
This is the result of the Mozilla's hackday after BrazilJS 2012.
The idea is to create a text-to-speech app to run on the Firefox OS.
Due to some restrictions (like audio media and cross-domain requests) we need to setup a small proxy. It is written in ruby, using sinatra and it requires ffmpeg to be installed with vorbis support.
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
http://callumacrae.github.com/regex-tuesday/ | |
Challenge 1 | |
/(\b(?:\w|')+) (\1\b)/ig -> $1 <strong>$2</strong> |
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
return (function(){ | |
function extractAssignments(role) { | |
return $("#" + role + " tbody tr").map(function() { | |
var $this = $(this); | |
var name = $this.find(".assignee-names").text().trim().replace(/ +/, " "); | |
var id; | |
if(name !== "None") { | |
id = $this.find(".assignee-names a").attr("href").match(/consultants\/(\d+)/)[1]; | |
} |
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
var robotFound = false; | |
var direction = 1; | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
if(!robotFound) { | |
robot.rotateCannon(1 * direction); |
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
var robotFound = {"one" : false | |
,"two": false}; | |
var splited = false; | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
var direction = 1; |