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
/* | |
Naive implementation of a range in Javascript. I needed that for a project, and coming from Ruby, I was disappointed to find there wasn't that. | |
So I implemented one. | |
b => beginning value of the range | |
e = ending value of the range | |
i => include or not the last value (.. or ... in Ruby) | |
*/ | |
var array = new Array; |
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
require 'time' | |
t = Time.now | |
h = t.hour | |
m = t.min | |
a = 1 | |
d = h - 9 | |
if d >= 0 |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# | |
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
bassline = Thread.new do | |
`yes "wub" | xargs say` | |
end | |
lead = Thread.new do | |
`say -v cellos Doo da doo da dum dee dee doodly doo dum dum dum doo da doo da doo da doo da doo da doo da doo` | |
end | |
bassline.join | |
lead.join |
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/ruby /Users/schatteleyn/manager.rb $1 $2 $3 $4 $5 |
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 | |
#coding: utf-8 | |
def convertor(string, delimiter='\n') | |
string.split(delimiter).each{ |c| c.capitalize! }.join(delimiter) | |
end | |
# Will remove capital letter in the rest of the string. Didn't found a simple way to keep them. |
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 java.util.regex.Pattern | |
def convert(in: String, delimiter: String) = in.split(Pattern.quote(delimiter)).toList.map(str => str.head.toUpper+str.tail).mkString(delimiter) | |
def convert(in: String):String = convert(in, "\n") | |
// Test with delimiter & without | |
println(convert("bli\nbla\nblu")) | |
println(convert("bli$bla$blu", "$")) |
NewerOlder