Skip to content

Instantly share code, notes, and snippets.

View gmontard's full-sized avatar

Guillaume Montard gmontard

View GitHub Profile
### Keybase proof
I hereby claim:
* I am gmontard on github.
* I am g_montard (https://keybase.io/g_montard) on keybase.
* I have a public key ASBW7TSjVux78jpy7fA4fdjTy4GhY-NVrI40dTbnTcCHrwo
To claim this, I am signing this object:
@gmontard
gmontard / export.xml
Created October 13, 2016 12:29
Jekyll export to Medium
---
layout: none
---
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wp="http://wordpress.org/export/1.2/">
<channel>
<title>{{ site.name }}</title>
<link>{{ site.url }}</link>
<description>{{ site.description | xml_escape }}</description>
<pubDate/>
@gmontard
gmontard / nginx-lang.lua
Last active April 8, 2018 11:01 — forked from mauron85/nginx-lang.lua
Detect preferred language script for Nginx written in LUA
-------------------------------------------------------------------------------
-- HTTP Accept-Language header handler --
-- @originalAuthor: f.ghibellini@gmail.com --
-- @originalRepository: https://github.com/fghibellini/nginx-http-accept-lang--
-- @modifiedBy: marian.hello@mapilary.com --
-- @originalgist: https://gist.github.com/mauron85/47ed1075262d9e020fe2 --
-- @modifedgist: https://gist.github.com/gmontard/b44534a3356c51d7047c --
-- @modifiedgist purpose: match geenral lang and not the region --
-- @license: MIT --
-- @requires: --
@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
# -*- 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"
class DomainConstraint
def initialize
end
def matches?(request)
domains = Domain.select("DISTINCT domain").map(&:domain).uniq
domains.include?(request.host)
end
end
class DomainConstraint
def initialize
end
def matches?(request)
@domains.include?(request.host)
end
end
@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
# -*- 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 / 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