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", "$")) |
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
/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
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/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
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
/* | |
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
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:364: warning: already initialized constant Revision | |
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:365: warning: already initialized constant HTTPVersion | |
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:369: warning: already initialized constant HAVE_ZLIB | |
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:677: warning: already initialized constant SSL_ATTRIBUTES | |
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:1416: warning: already initialized constant HTTPSession | |
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:2109: warning: already initialized constant METHOD | |
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:2110: warning: already initialized constant REQUEST_HAS_BODY | |
/Users/username/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/net/http.rb:2111: warning: already initialized constant RESPONSE_HAS_BODY | |
/Users/username/.rvm/rub |
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 'trollop' | |
opts = Trollop.options do | |
banner <<-EOS | |
This programs help you to do a running order. Use it like this: | |
ruby lineup.rb -b Band "Best Band Ever" -t 30 75 -e 21 25 -s 20 | |
Band | |
Set: 21:25 - 21:55 |
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
computer = #path to movies directory | |
hd = #path to movies directory | |
def get_movies(path_comp, path_hd) | |
# Return ana rray with only the new movies. I exclude the directory Series in the search | |
return `ls #{path_comp} | grep -v Series`.split(/\n/) - `ls #{path_hd} | grep -v Series`.split(/\n/) | |
end | |
new_movies_list = get_movies(computer, hd) |
OlderNewer