Skip to content

Instantly share code, notes, and snippets.

View Dagnan's full-sized avatar

Michel Pigassou Dagnan

View GitHub Profile
@lrascao
lrascao / gist:f57312ff33b799c4c0db56b10e80fe26
Created March 31, 2016 16:19
Export/Import datadog dashboards
dash_id=xxxx
api_key=xxx
app_key=xxx
# 1. export
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json
# 2. edit dash.json
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level
@pcreux
pcreux / Gemfile
Last active December 11, 2023 20:24
Fast Rails + Heroku Configuration
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'
end
@nicolasblanco
nicolasblanco / _form.html.haml
Last active December 21, 2015 22:58
Twitter Date Picker localized on front and with only ISO sent/retrieved from the server
= f.input :date_of_birth, as: :date_picker
@kevinrutherford
kevinrutherford / spec_helper.rb
Created August 7, 2011 10:59
Mocking warden in controller specs
module RandomHelpers
def random_number() SecureRandom.random_number(10000); end
def random_id() random_number; end
def random_name() SecureRandom.hex(20); end
end
module ControllerHelpers
def user_double(attrs = {})
user_attrs = {
:first_name => random_name,