Skip to content

Instantly share code, notes, and snippets.

View robinclart's full-sized avatar

Robin robinclart

View GitHub Profile
@robinclart
robinclart / .emacs
Created January 5, 2017 03:17
.emacs
(setq scroll-step 1
scroll-conservatively 10000)
(menu-bar-mode -1)
(set-window-margins nil 1)
(setq linum-format "%d ")
@robinclart
robinclart / .tmux.conf
Last active January 8, 2017 13:51
.tmux.conf
set-option -g default-command "reattach-to-user-namespace -l fish"
# force a reload of the config file and display "~/.tmux.conf Reloaded!"
unbind r
bind r source-file ~/.tmux.conf \
# window splitting
bind | split-window -h
bind - split-window -v

Keybase proof

I hereby claim:

  • I am robinclart on github.
  • I am robinclart (https://keybase.io/robinclart) on keybase.
  • I have a public key whose fingerprint is 21DA B729 A5D1 BBF0 4695 4243 C87F EADB E5FD 594C

To claim this, I am signing this object:

@robinclart
robinclart / randomize_sentence.rb
Last active August 29, 2015 13:57
Randomize the content within brackets in the form of [ a | b ]
require "benchmark"
# Originally written by @blazeeboy
# See https://gist.github.com/9429208
def generate(result)
# ...
end
def randomize_sentence(sentence)
randomized_sentence = sentence.gsub(/\[[^\[\]]+\]/) { |s| s[1..-2].split("|").shuffle.first }
@robinclart
robinclart / nav.js
Created March 3, 2013 20:02
Navigation highlighting for one page website
(function() {
var Nav;
Nav = (function() {
function Nav(selector) {
this.selector = selector;
this.element = $(this.selector || "[data-nav]").first();
this["class"] = this.element.data("nav");
this.height = this.element.parent().height();
@robinclart
robinclart / ridiculous.rb
Created August 20, 2012 17:29
ridiculous
require "active_support/all"
require "active_model/naming"
class SuperFoo
A_CONSTANT = 3.14
def greet
puts "Hi! + #{A_CONSTANT}"
end
@robinclart
robinclart / casanova.gemspec
Created April 18, 2012 03:48
A class to parse csv document
Gem::Specification.new do |s|
s.name = "casanova"
s.version = "0.1.0"
s.platform = Gem::Platform::RUBY
s.author = "Robin Clart"
s.email = "robin@clart.be"
s.summary = ""
s.description = ""
s.files = ["casanova.rb"]
@robinclart
robinclart / birthday.rb
Created April 17, 2012 07:01
A module and a class to deal with birthday
require "date"
module Birthday
def birthday(year_of_birthday = Date.today.year)
if birthdate.leap?
year_of_birthday += 1 until Date.new(year_of_birthday).leap?
end
Date.new(year_of_birthday, birthdate.month, birthdate.day)
end