Skip to content

Instantly share code, notes, and snippets.

Hadrien Blanc hadrienblanc

Block or report user

Report or block hadrienblanc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cast_to_boolean.rb'MY_ENV_VARIABLE', false))
View increase_aws_volume_size.rb
lsblk # show the volume size
sudo file -s /dev/xvdf # know your filesystem type
sudo xfs_growfs -d /home/ubuntu/data/ # increase your mount folder
View auth.rb
require 'rest-client'
require 'json'
client_id = '42f5e************************'
client_secret = 'secret-b42-************************'
response ='', {
grant_type: 'client_credentials',
client_id: client_id,
View exists.mongo
{ "attribute_1": {$exists:true}, "attribute_2": "value_wanted"}
# mass change xml filename
for file in *.xml; do
mv "$file" "${file%.xml}_p.xml"
ls | xargs -I {} mv {} PREF_{}
git diff --stat master
git log --stat
screeen -ls # list the screens
screen -S session_name # create a session
# how to detach ? : Ctrl+a d
screeen -ls # list the screens and find the ID
screen -r 42 # 42 is the ID of the screen
View attach_active_storage.rb
some_profile.avatar.attach(io:'/path/to/file'), filename: 'avatar.png')
You can’t perform that action at this time.