Skip to content

Instantly share code, notes, and snippets.

View gmontard's full-sized avatar

Guillaume Montard gmontard

View GitHub Profile
#
# Mac OS X / Mac OS X Server
# The <IfDefine> blocks segregate server-specific directives
# and also directives that only apply when Web Sharing or
# server Web Service (as opposed to other services that need Apache) is on.
# The launchd plist sets appropriate Define parameters.
# Generally, desktop has no vhosts and server does; server has added modules,
# custom virtual hosts are only activated when Web Service is on, and
# default document root and personal web sites at ~username are only
# activated when Web Sharing is on.
@gmontard
gmontard / override_assetfile_cache.rb
Created April 20, 2012 13:18
Sync asset cached file to Windows Azure using waz-sync gem
#####
## Add this line to your environment.rb file
# require 'lib/override_assetfile_cache.rb'
####
module ActionView
module Helpers
module AssetTagHelper
def write_asset_file_contents(joined_asset_path, asset_paths)
/opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:234:in `load': super: no superclass method `load' for main:Object (NoMethodError)
from /opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:223:in `load_dependency'
from /opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:223:in `load_dependency'
from /opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:234:in `load'
from /opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems/activesupport-3.1.4/lib/active_support/dependencies.rb:232:in `to_proc'
from /opt/boxen/rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems
@gmontard
gmontard / gist:6006428
Created July 16, 2013 07:04
Unicorn Conf for Zero downtime Deploy !
require "redis"
worker_processes 8
preload_app true
timeout 600
listen '/tmp/vodeclic.sock', :backlog => 1024
pid '/tmp/vodeclic.pid'
##
# REE
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@gmontard
gmontard / domain.rb
Last active October 20, 2023 21:44
Rails dynamic domain and subdomain routes constraint
# -*- encoding : utf-8 -*-
class Domain < ActiveRecord::Base
after_save :reload_routes
def reload_routes
if self.domain_changed?
REDIS.set("rails_routes_ts", "expired")
end
end
class DomainConstraint
def initialize
end
def matches?(request)
@domains.include?(request.host)
end
end
class DomainConstraint
def initialize
end
def matches?(request)
domains = Domain.select("DISTINCT domain").map(&:domain).uniq
domains.include?(request.host)
end
end
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
##### Custom Settings ####
private_ip = ENV['VAGRANT_PRIVATE_IP'] || "10.0.0.42"
@gmontard
gmontard / .env
Last active August 29, 2015 14:03
WHILE42PARIS_DB_USERNAME=root
WHILE42PARIS_DB_PASSWORD=while42
WHILE42PARIS_DB_HOST=10.0.0.42
WHILE42PARIS_DB_PORT=3306