Skip to content

Instantly share code, notes, and snippets.

Maxime Bouroumeau-Fuseau maximebf

View GitHub Profile
View gist:988f45bbda2942cb12c5
### Keybase proof
I hereby claim:
* I am maximebf on github.
* I am maximebf ( on keybase.
* I have a public key whose fingerprint is 6406 AD6C BB97 BE07 6B87 C7B3 682E 2EB1 7598 80E1
To claim this, I am signing this object:
View mgitstatus
# Display the status of all git directories in the current directory
show() {
cd $1
branch=`git branch 2> /dev/null | grep -e ^* | sed -E s/^\\\\\*\ \(.+\)$/\\\\\1/`
if [ -n "`git status 2> /dev/null | grep 'nothing to commit'`" ]; then
maximebf / config_files.rb
Last active Feb 19, 2016
Plugins, configuration files and fabfile to help you manage a multi-site jekyll setup
View config_files.rb
module Jekyll
class Site
def read
def read_config(dir='')
maximebf /
Last active Dec 19, 2015
Fabfile to publish jekyll blogs with supervisor and nginx configuration
from fabric.api import task, env, execute, local
env.build_path = '/tmp/jekyll'
env.publish_path = '~/sites'
def serve(future='yes', drafts='yes', port=4000):
flags = []
maximebf / drafts.rb
Created Nov 24, 2012
Draft plugin for jekyll
View drafts.rb
# Search for posts in _drafts folder
# Add "drafts: true" in your config file to
# activate the plugin
# Filenames should not have a date
# eg: _drafts/
# Draft posts will have a post.draft property
maximebf / gist:3986659
Created Oct 31, 2012
Jinja2 macro to render WTForms fields with Twitter Bootstrap
View gist:3986659
{% macro form_field(field) -%}
{% set with_label = kwargs.pop('with_label', False) %}
{% set placeholder = '' %}
{% if not with_label %}
{% set placeholder = field.label.text %}
{% endif %}
<div class="control-group {% if field.errors %}error{% endif %}">
{% if with_label %}
<label for="{{ }}" class="control-label">
{{ field.label.text }}{% if field.flags.required %} *{% endif %}:
maximebf / gist:3986583
Created Oct 31, 2012
Add dynamic subdomain support to a Flask app
View gist:3986583
def add_subdomain_to_global(endpoint, values):
g.subdomain = values.pop('subdomain', None)
def add_subdomain_to_url_params(endpoint, values):
if not 'subdomain' in values:
values['subdomain'] = g.subdomain
def add_subdomain_support(app):
maximebf /
Created Aug 4, 2012
Small Flask app that exposes an API to query French's RATP schedule
#!/usr/bin/env python
# coding: utf-8
from flask import Flask, request, jsonify
import urllib2
from BeautifulSoup import BeautifulSoup
app = Flask(__name__)
maximebf /
Created Feb 5, 2012
Fabfile to deploy a jekyll site
from fabric.api import task, run, env, execute, local, put, lcd
env.site_path = '/tmp/jekyll-site'
env.tar_filename = env.site_path + '.tar.bz2'
env.remote_site_path = '~/public_html'
def build():
local("jekyll %s" % env.site_path)
maximebf /
Created Oct 21, 2011
Web tail / tail -f as a webpage using websocket
# Equivalent of "tail -f" as a webpage using websocket
# Tested with tornado 2.1
# Thanks to Thomas Pelletier for it's great introduction to tornado+websocket
import tornado.httpserver
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.