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
module V1A | |
def mpla | |
"#{foo} from mpla" | |
end | |
def foo | |
return 'from V1' | |
end | |
end |
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
# self | |
class Foo | |
# self | |
# belongs_to | |
def Foo.foo | |
@bla = '123' | |
puts 'bla' | |
end |
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 | |
require 'csv' | |
require 'json' | |
if ARGV.size != 2 | |
puts 'Usage: csv_to_json input_file.csv output_file.json' | |
puts 'This script uses the first line of the csv file as the keys for the JSON properties of the objects' | |
exit(1) | |
end |
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 | |
# | |
# Git commit-msg hook. If your branch name is in the form "SYSRAP-123", automatically | |
# adds "Refs #SYSRAP-123." to commit messages unless they mention "#SYSRAP-123" already. | |
# | |
# By Henrik Nyh <http://henrik.nyh.se> 2009-09-10 under the MIT License. | |
# | |
# | |
# Install: | |
# |
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
loop do | |
Sidekiq::Client.registered_queues.each do |q| | |
Sidekiq.redis do |r| | |
puts "#{q} #{r.lrange("queue:#{q}", 0, -1).size}" | |
end | |
end | |
sleep(10) | |
puts "\e[H\e[2J" | |
end |
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
def specialFrenchGermanCharactersToBase64(str: String) = { | |
str.replaceAll("À", "%C3%80") | |
.replaceAll("Â", "%C3%82") | |
.replaceAll("Ç", "%C3%87") | |
.replaceAll("É", "%C3%89") | |
.replaceAll("È", "%C3%88") | |
.replaceAll("Ê", "%C3%8A") | |
.replaceAll("Ë", "%C3%8B") | |
.replaceAll("Î", "%C3%8E") | |
.replaceAll("Ï", "%C3%8F") |