Skip to content

Instantly share code, notes, and snippets.

View guillaumevincent's full-sized avatar

Guillaume Vincent guillaumevincent

View GitHub Profile
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@guillaumevincent
guillaumevincent / button.styl
Created November 12, 2013 15:16
Button stylus and jade test
red = #DC2E2D
white = #FFFFFF
green = #3C8F48
blue = #2A6BEB
orange = #F3A527
black = #000000
grey = #848484
dark = #111111
darkblue = #303886
cyan = #3893B4
html, body{
height: 100%;
}
body {
background: rgb(245,245,245);
font-family: arial,sans-serif;
}
input {
padding: 10px;
display: block;
@guillaumevincent
guillaumevincent / pip-verification.py
Created March 16, 2013 17:25
Get from http://code.activestate.com/recipes/577708-check-for-package-updates-on-pypi-works-best-in-pi/ Pip has an option to upgrade a package (_pip install -U_), however it always downloads sources even if there is already a newest version installed. If you want to check updates for all installed packages then some scripting is required. This s…
#!/usr/bin/env python
import xmlrpclib
import pip
pypi = xmlrpclib.ServerProxy('http://pypi.python.org/pypi')
for dist in pip.get_installed_distributions():
available = pypi.package_releases(dist.project_name)
if not available:
# Try to capitalize pkg name
@guillaumevincent
guillaumevincent / login.html
Last active December 1, 2020 01:26
Basic authentication on Tornado with a decorator
<div id="main-container">
<div id="main">
<h1>
<img alt="scubabook logo" src="{{ static_url("img/logo.png") }}">
</h1>
<div id="login-form">
<form action="/auth/login/" method="post" id="login_form">
<fieldset>
<label for="username">Username</label>
<input autocapitalize="off" autocorrect="off" class="text-input" id="username" name="username" tabindex="1" type="text" value="">
@guillaumevincent
guillaumevincent / gist:4745647
Last active December 12, 2015 08:39
Basic authentication with Tornado. Tornado doesn't provide a good documentation when you try to handle your own login service. I tried to do mine My new gist : https://gist.github.com/guillaumevincent/4771570
import tornado.auth
import tornado.escape
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
import Settings
from tornado.options import define, options