Skip to content

Instantly share code, notes, and snippets.

View yannlugrin's full-sized avatar

Yann Lugrin yannlugrin

View GitHub Profile
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {
Dir[Rails.root.join('**', '*.rb')].each do |f|
c = File.open(f).read
File.open(f, 'w').write("# encoding: UTF-8\n" + c)
end
Host srv1
Hostname srv1.client.fr
User root
ProxyCommand ssh firewall nc %h %p
Host srv2
Hostname srv2.client.fr
User root
ProxyCommand ssh firewall nc %h %p
#!/bin/bash
#
# Set our bash prompt according to the branch/status of the current git
# repository.
#
# Forked from http://gist.github.com/31967
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"