Skip to content

Instantly share code, notes, and snippets.

Philippe Creux pcreux

Block or report user

Report or block pcreux

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
pcreux / Gemfile
Last active Jun 25, 2019
Fast Rails + Heroku Configuration
View Gemfile
group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
pcreux / format_bundle_outdated.rb
Created May 31, 2019
Format 'bundle outdated' into a CSV file ordered by version delta
View format_bundle_outdated.rb
#!/usr/bin/env ruby
# Run `bundle outdated | format_bundle_outdated`
# to get a CSV file listing the columns below for all outdated gems.
COLUMNS = [ "name", "newest", "installed", "requested", "groups", "delta" ].join(",")
class Version <, :minor, :patch, :beta)
pcreux / sendgrid via curl
Created Sep 27, 2013
Send email via the command line with sendgrid. Get notified when a long running script is done on a remote server.
View sendgrid via curl
curl ""
pcreux /
Created Feb 18, 2013
Github Commit Status API with Bamboo from Atlassian. Add those to your plan as Script.
# specs and cukes results are stored in JUnit format under test-reports
if (grep 'failures="[^0]"' test-reports/* || grep 'errors="[^0]"' test-reports/*); then
curl -H "Authorization: token MY_TOKEN" --request POST --data '{"state": "failure", "description": "Failed!", "target_url": "${bamboo.buildResultsUrl}"}'${bamboo.repository.revision.number} > /dev/null
curl -H "Authorization: token MY_TOKEN" --request POST --data '{"state": "success", "description": "Success!", "target_url": "${bamboo.buildResultsUrl}"}'${bamboo.repository.revision.number} > /dev/null
pcreux /
Last active Dec 21, 2018
Gourmet Service Objects - Lightning Talk - - Feb 27, 2014

Gourmet Service objects


 Feb 27, 2014
pcreux / Jabber-SH
Created Dec 17, 2009
Jabber-SH — SH console via XMPP/Jabber (GTalk) Jabber-SH allows to you to administrate a remote computer via a command line through a Jabber client. It’s like SSH via GoogleTalk! :)
View Jabber-SH
#!/usr/bin/env ruby
# Jabber-SH — SH console via XMPP/Jabber (GTalk)
# Jabber-SH allows you to administrate a remote computer via a command line
# through a Jabber client. It’s like SSH via GoogleTalk! :)
# This is just a hack but it might be usefull sometime to run basic commands
# on a machine that is not accessible via ssh.
# Philippe Creux. pcreux/AT/gmail/DOT/com
pcreux / pipable.rb
Last active Jun 12, 2018
*nix has pipes, Elixir has pipes, Ruby deserves pipes.
View pipable.rb
# Elixir has pipes `|>`. Let's try to implement those in Ruby.
# I want to write this:
# email.body | RemoveSignature | HighlightMentions | :html_safe
# instead of:
pcreux / 000 Oh no conditionals!.png
Last active Jun 6, 2018
Turning imperative conditionals into declarative rules
pcreux /
Last active May 14, 2018
Robust Rails Apps - VanRuby - March 29, 2017

Robust Rails Apps

Philippe Creux - @pcreux

#vanruby - March 29th, 2017

pcreux / convert-to-ipad.rb
Last active May 3, 2018
ffmpeg - avi to mp4 - iPad
View convert-to-ipad.rb
# ruby convert-to-ipad.rb video1.avi video2.avi video3.avi
# Prereq: brew install ffmpeg
ARGV.each do |input_file|
output_file = input_file.gsub('.avi', '.ipad.mp4')
cmd = "ffmpeg -i #{input_file} -acodec aac -ac 2 -strict experimental -ab 160k -s 1024x768 -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1200k -f mp4 -threads 0 #{output_file}"
puts cmd
system cmd
You can’t perform that action at this time.