Skip to content

Instantly share code, notes, and snippets.

View cvan's full-sized avatar
🚌
🌊

Christopher Van Wiemeersch cvan

🚌
🌊
View GitHub Profile
alias i from IPython.Shell import IPShellEmbed as IPSh; IPSh(argv='')()
@cvan
cvan / gist:4187594
Created December 2, 2012 07:26
I like you. You like me.
# You like me.
curl -X POST -d 'yes=1&me=girl' 'http://localhost:5000/heygirlilikeartsybakedgoodstoo/cvan'
# I like you.
curl -X POST -d 'yes=1&me=cvan' 'http://localhost:5000/heygirlilikeartsybakedgoodstoo/girl'
# In mine.
curl 'http://localhost:5000/heygirlilikeartsybakedgoodstoo/cvan'
curl 'http://localhost:5000/heygirlilikeartsybakedgoodstoo/cvan?unread'
@cvan
cvan / gist:4229165
Created December 6, 2012 22:44
workflow for remotely tracked branch
git branch --track desktop origin/desktop
git checkout master
git pull --rebase
git checkout -
git merge master
git push origin desktop
@cvan
cvan / z.sh
Last active July 31, 2022 06:52
install zamboni
# Install homebrew.
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
# Acquire compiled dependencies.
brew install python libxml2 mysql libmemcached openssl swig jpeg redis elasticsearch
# Start services.
mkdir -p ~/Library/LaunchAgents
ln -nfs /usr/local/Cellar/mysql/*/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
ln -nfs /usr/local/Cellar/redis/*/homebrew.mxcl.redis.plist ~/Library/LaunchAgents/
@cvan
cvan / less2stylus.js
Last active January 7, 2025 08:29 — forked from MoOx/less2stylus.js
// Usage : less2stylusDir('../src/css/');
var fs = require('fs');
// this less 2 stylus conversion script make a stylus easy to read syntax
// - let the braces
// - replace the @ for var as $
// - let semicolons
function less2stylus(less)
{
"name": "servers",
"windows": [
{
"name": "zamboni",
"command": ". ~/s/z-runserver"
}, {
"name": "solitude",
"command": ". ~/s/s-runserver"
}, {
for file in `git diff-tree --no-commit-id --name-only -r HEAD | sort | uniq`
do
if [ ${file: -3} == ".py" ]
then
flake8 --ignore=E121,E123,E124,E125,E126,E127,E128 $file
fi
if [ ${file: -3} == ".js" ]
then
jshint $file
fi
{
"origin": "app://marketplace.firefox.com",
"installOrigin": "https://marketplace.firefox.com",
"manifestURL": "https://marketplace.firefox.com/minifest.webapp?carrier=telefonica",
"type": "web",
"removable": false
}
$.fn.serializeObject = function() {
var data = {};
_.each($(this).serializeArray(), function(v, k) {
k = v.name;
v = v.value;
if (_.contains(k, '__prefix__')) {
return;
}
if (k.match(/\-\d+\-/g)) {
// Turn `users-0-name=Basta` into
@cvan
cvan / refresh.js
Created April 10, 2013 21:49
lets you refresh an app in the simulator
window.addEventListener('keydown', function(e) {
if (e.keyCode == 82 && e.metaKey) {
window.location.reload();
}
});