Skip to content

Instantly share code, notes, and snippets.

View Flink's full-sized avatar

Loïc Guitaut Flink

View GitHub Profile
@Flink
Flink / git-lh.rb
Created June 29, 2011 13:26
git/lighthouse push commits working with differents branches and ruby 1.9.2
#!/usr/bin/env ruby
require 'yaml'
require 'cgi'
require 'net/http'
git = `which git`.strip
current_branch = `#{git} branch |grep '*'|sed 's/^\*\s*//'`.strip
first = ARGV.shift || "origin/#{current_branch}"
last = ARGV.shift || 'HEAD'
@Flink
Flink / in console
Created March 27, 2012 14:58
Always exception with strong parameters
params = ActionController::Parameters.new({movie: {title: 'test', overview: 'test', released_on: Date.today}})
m = Movie.create params.required(:movie).permit(:title, :overview, :released_on)
class MovieScreen < PM::Screen
title 'Movie details'
stylesheet :movie_details
attr_accessor :movie
def on_load
self.title = movie.full_title
end
Teacup::Stylesheet.new :movie_details do
style :main_view,
background: '#DBDBDB'
style :poster,
origin: [10, 10],
shadow: {
radius: 4.0,
opacity: 0.4,
color: :black
},
# Path to your oh-my-fish.
set fish_path $HOME/.oh-my-fish
# Theme
set fish_theme bobthefish
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-fish/plugins/*)
# Custom plugins may be added to ~/.oh-my-fish/custom/plugins/
# Example format: set fish_plugins autojump bundler
INFO global: Vagrant version: 1.4.1
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Linux"
INFO global: VAGRANT_INSTALLER_ENV="1"
DEBUG global: Loading core plugin: /opt/vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/hosts/redhat/plugin.rb
INFO manager: Registered plugin: Red Hat host

Keybase proof

I hereby claim:

  • I am flink on github.
  • I am flink (https://keybase.io/flink) on keybase.
  • I have a public key whose fingerprint is 7F41 DC5D 4084 0A5E 00BD CA1C B74E 0ED2 1FEE B9ED

To claim this, I am signing this object:

#!/bin/env ruby
require 'digest/sha2'
require 'io/console'
DIGESTS = [:MD5, :SHA1, :SHA256, :SHA384, :SHA512]
print 'Type passphrase: '
passphrase = STDIN.noecho(&:gets).chomp
print "\nType passphrase again: "
@Flink
Flink / gist:bb6cbf28871b9541ba6c
Last active July 17, 2018 18:57
Ruby DCI articles & related
http://rubyrogues.com/056-rr-david-heinemeier-hansson/
http://mikepackdev.com/blog_posts/24-the-right-way-to-code-dci-in-ruby
http://mikepackdev.com/blog_posts/37-dci-the-king-of-the-open-closed-principle
http://decomplecting.org/blog/2013/01/03/dci-the-right-idea-for-the-wrong-paradigm/
http://evan.tiggerpalace.com/articles/2011/11/24/dci-that-respects-the-method-cache/
http://tonyarcieri.com/dci-in-ruby-is-completely-broken
https://signalvnoise.com/posts/3372-put-chubby-models-on-a-diet-with-concerns
http://blog.codeclimate.com/blog/2012/12/19/dci-concerns-and-readable-code/
http://blog.codeclimate.com/blog/2012/10/17/7-ways-to-decompose-fat-activerecord-models/
http://martinfowler.com/bliki/AnemicDomainModel.html
@Flink
Flink / .profile
Created November 2, 2014 22:17
256 colors in gnome-terminal
if ! [[ $TERM =~ 256color ]]; then
export TERM="$TERM-256color"
fi