Skip to content

Instantly share code, notes, and snippets.

View wo0dyn's full-sized avatar

Nicolas C. Dubois wo0dyn

View GitHub Profile
@pelletier
pelletier / fabfile.py
Created November 28, 2010 12:50
Deployment script for Python-based web applications which use Gunicorn following the Capistrano way.
"""
Thomas Pelletier's Python deployment script.
MIT Licensed.
We assume that:
* deploy.py lives in the root of your project.
* In the same directory, there is a dependencies.txt file, in PIP format.
* Remote host has a working Python+VENV+PIP environment.
* You have enough privileges.
@rwilcox
rwilcox / installing_python_packages_programatically.py
Created December 26, 2010 17:32
How to use PIP to install Python packages programmatically.py
#!/usr/bin/env python
"""
PIP can stand for PIP Installs packages Programmatically, too!
(and here's how)
Requires:
* Python 2.6 or higher (for print-as-a-function)
* PIP 0.8.2
"""
@andrei-m
andrei-m / levenshtein.js
Last active October 9, 2024 10:36
Levenshtein distance between two given strings implemented in JavaScript and usable as a Node.js module
/*
Copyright (c) 2011 Andrei Mackenzie
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@yannmadeleine
yannmadeleine / gist:1082570
Created July 14, 2011 14:34
calculate cost and time for a travel in car via highway in france
from selenium import webdriver
from selenium import selenium
from webdriver import DesiredCapabilities
import re
to_cities = ['toulouse', 'bordeaux', 'marseille']
from_cities = [
'paris',
'toulouse',
'bordeaux',
@coldnebo
coldnebo / Default (Linux).sublime-keymap
Created August 10, 2011 23:20
simple scripts to prettify your xml and json in sublime text 2
[
{ "keys": ["ctrl+shift+x"], "command": "tidy_xml" },
{ "keys": ["ctrl+shift+j"], "command": "prettify_json" }
]
@streeter
streeter / pre-commit.py
Created November 18, 2011 16:02
Python .git/hooks/pre-commit hook
#!/usr/bin/env python
import os
import re
import subprocess
import sys
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')
CHECKS = [
from django.db import models
optional = dict(blank=True, null=True)
class Foo(models.Model):
bar = models.CharField()
baz = models.CharField(**optional)
>>> import cong
>>> cong.lets_get_the_party_started()
@panicsteve
panicsteve / gist:1641705
Created January 19, 2012 18:26
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
@kevinSuttle
kevinSuttle / meta-tags.md
Last active November 7, 2024 10:05 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags