Skip to content

Instantly share code, notes, and snippets.

Disclaimer : motivé par Mathieu Sanchez je publie ce draft qui a plus de quatre ans. Ce sont clairement des hot takes et les plus chaudes sont à expliquer ou revoir. Je vais laisser comme tel, mais ajouter des étoiles. Encore merci Mathieu : https://www.linkedin.com/posts/matsanchez_humour-dev-orelsan-activity-6972841728902840320-fGyj/

Simple, Basique

OK, j'vais sortir un nouveau talk
Mais, avant, faut qu'on revoit les bases
J'vais faire un talk simple où j'vais dire des trucs simples

@xhocquet
xhocquet / config.yml
Created October 12, 2018 22:55
Rubocop + CircleCI
# One of the steps, insert where you wish:
- run:
name: run rubocop
command: |
source /home/circleci/.rvm/scripts/rvm
rvm --default use 2.3.1
bash bin/rubocop.sh
# Remove the RVM lines if not needed for your setup
@tkrajina
tkrajina / call_method_with_reflection.go
Created April 1, 2016 09:14
Golang, call method (and fill arguments) with reflection
package main
import (
"fmt"
"reflect"
)
type Aaa struct {
a string
}
@phlegx
phlegx / Rails 4 - how to give alias names to includes() and joins() in active record quering
Last active February 12, 2024 19:12
Rails 4 - how to give alias names to includes() and joins() in active record quering
See question on stack overflow: http://stackoverflow.com/questions/28595636/rails-4-how-to-give-alias-names-to-includes-and-joins-in-active-record-que
- Model Student and model Teacher are both STI models with super class model User
- Model Story is a STI model with super class model Task
- includes() and joins(), both fails
Rails alias naming convention (includes() and joins())
- One model as parameter
- is base model (includes(:users))
@djburdick
djburdick / rubocop_circleci.rb
Created November 11, 2014 20:18
Run rubocop with circleci
# In spec_helper.rb
RSpec.configure do |config|
....
rubocop_output = `rubocop`
print rubocop_output
fail "RuboCop Errors" unless rubocop_output.match(/files inspected, no offenses detected/)
end
@aurels
aurels / gist:843967
Created February 25, 2011 15:45
stream system command output to STDOUT (ruby)
IO.popen('ant run') do |io|
while (line = io.gets) do
puts line
end
end