Skip to content

Instantly share code, notes, and snippets.

View flomotlik's full-sized avatar

Florian Motlik flomotlik

View GitHub Profile
@flomotlik
flomotlik / Gemfile
Created April 18, 2013 13:41
Heroku require
gem 'heroku', require: false
#!/bin/bash
heroku pgbackups:capture --expire --app YOUR_PRODUCTION_APP_NAME
heroku pgbackups:restore DATABASE `heroku pgbackups:url --app YOUR_PRODUCTION_APP` --app YOUR_STAGING_APP --confirm YOUR_STAGING_APP
@flomotlik
flomotlik / coveralls_multiple.rb
Last active December 16, 2015 15:59
Getting Started with Coveralls
#Coveralls with Rspec and Cucumber
require 'coveralls'
Coveralls.wear_merged!
SimpleCov.merge_timeout 3600
#MAKING SURE SIMPLECOV WORKS WITH THE PARALLEL_TESTS GEM
SimpleCov.command_name "RSpec/Cucumber:#{Process.pid.to_s}#{ENV['TEST_ENV_NUMBER']}"
require 'coveralls'
Coveralls.wear!
repo_token: YOUR_COVERALLS_TOKEN
require 'coveralls/rake/task'
Coveralls::RakeTask.new
@flomotlik
flomotlik / gist:5709952
Last active December 18, 2015 02:18
Exported Commit variables
'CI' => true,
'CI_BUILD_NUMBER' => id,
'CI_BUILD_URL' => project_build_url(project, self),
'CI_PULL_REQUEST' => false,
'CI_BRANCH' => branch,
'CI_COMMIT_ID' => commit_id,
'CI_COMMITTER_NAME' => name,
'CI_COMMITTER_EMAIL' => email,
'CI_COMMITTER_USERNAME' => github_username,
'CI_MESSAGE' => message,
@flomotlik
flomotlik / gist:6126313
Created July 31, 2013 21:22
Install casperjs development into virtual machine
mkdir casperjs1.1
cd casperjs1.1
wget https://codeload.github.com/n1k0/casperjs/legacy.zip/1.1-beta1
unzip 1.1-beta1
export PATH=~/clone/casperjs1.1/n1k0-casperjs-cd1fab5/bin:$PATH
casperjs --version
cd ..
@flomotlik
flomotlik / gist:6212725
Last active November 13, 2017 18:46
Wget Curl comparison and our Approach

We have changed our check_url implementation from curl to wget for three reasons

  1. It gives us the ability to retry on connection refused. Compare the command we used previously with curl:
curl -sSfL --retry 3 URL

to the current one:

@flomotlik
flomotlik / start_server.rb
Created September 12, 2013 08:50
Setting up our Amazon machines
# Creating the EC2 Instance
instance = ec2.instances.create(
:image_id => "ami-7739b41e",
:instance_type => 'cc2.8xlarge',
:key_name => "CloudshipCreateServerKey",
:instance_initiated_shutdown_behavior => 'terminate',
:block_device_mappings => {
"/dev/sda1" => {
:volume_size => 50,