Skip to content

Instantly share code, notes, and snippets.

View gregory's full-sized avatar
🎯
Focusing

Grégory Horion gregory

🎯
Focusing
View GitHub Profile
@gregory
gregory / how_i_got_my_mom_running_her_ruby_cms_on_a_cluster.md
Created September 4, 2014 15:37
This is a quick post on how to setup locomotive_cms locally for testing or production. Or, how you can get your mom running her own cluster.

#Panamax - Or how I got my mom running her ruby cms ... on a cluster!

First things first:

If you know the pain to get your mom running her own cluster please show me some love here by clicking on the star button!

##Pana what?

Panamax is not the new trendy word for yet another icebucket challenge, but the new open source tool for humans to help you manage your docker architecture, that made some noise lately.

@gregory
gregory / keybase.md
Created December 17, 2014 22:43
keybase.md

Keybase proof

I hereby claim:

  • I am gregory on github.
  • I am metakungfu (https://keybase.io/metakungfu) on keybase.
  • I have a public key whose fingerprint is 5732 A452 4293 97A9 3A9F 434E 61F7 AA9F 3DDD D2C0

To claim this, I am signing this object:

namespace :db do
require "sequel"
Sequel.extension :migration
DB = Sequel.connect(ENV['DATABASE_URL'])
desc "Prints current schema version"
task :version do
version = if DB.tables.include?(:schema_info)
DB[:schema_info].first[:version]
end || 0
require 'csv'
module Extensions
module Csv
module ClassMethods
# Public: import a csv file
#
# file_path - the filepath of the csv file
#
# Yields a hash of the values of the row
@gregory
gregory / .README.md
Last active August 29, 2015 14:14 — forked from gnarf/..git-pr.md

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from GitHub remotes:

  • git pr 4 - creates local branch pr/4 from the origin remote and checks it out
  • git pr 4 upstream - creates local branch pr/4 from upstream remote and checks it out
class ParserStrategy
def parse
raise NotImplementedError
end
end
class GoogleParser < ParserStrategy
def parse
GoogleTranslate.translate raw
end
@gregory
gregory / scraping.rb
Last active August 29, 2015 14:18 — forked from ngauthier/scraping.rb
#!/usr/bin/env ruby
# From: http://ngauthier.com/2014/06/scraping-the-web-with-ruby.html
require 'capybara'
require 'capybara/poltergeist'
require 'csv'
require 'gdbm'
class NickBot
include Capybara::DSL
@gregory
gregory / Gemfile
Last active August 29, 2015 14:19 — forked from Burgestrand/Gemfile
source :rubygems
gem 'pry'
gem 'capybara'
gem 'capybara-webkit'
gem 'celluloid'
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
@gregory
gregory / README.md
Created November 21, 2015 06:52 — forked from oscarrenalias/README.md
Docker service discovery with HAproxy, consul and registrator on Docker Machine and Docker Swarm