Skip to content

Instantly share code, notes, and snippets.

@kennethreitz
kennethreitz / phantom-jasmine-xunit.js
Created June 17, 2011 23:33 — forked from tmpvar/phantom-jasmine-xunit.js
xunit output from jasmine tests
if (phantom.state.length === 0) {
if (phantom.args.length !== 1) {
console.log('Usage: run-jasmine.js URL');
phantom.exit();
} else {
phantom.state = 'run-jasmine';
phantom.open(phantom.args[0]);
}
} else {
window.setInterval(function () {
@mourner
mourner / TileLayer.Common.js
Created February 11, 2012 23:11
Leaflet shortcuts for common tile providers
// Lefalet shortcuts for common tile providers - is it worth adding such 1.5kb to Leaflet core?
L.TileLayer.Common = L.TileLayer.extend({
initialize: function (options) {
L.TileLayer.prototype.initialize.call(this, this.url, options);
}
});
(function () {
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@abulte
abulte / bootstrap.sh
Created October 19, 2012 10:21
Build a custom RPI image
#!/bin/bash
# Based on work by Klaus M Pfeiffer at http://blog.kmp.or.at/2012/05/build-your-own-raspberry-pi-image/
# you need to do: "sudo apt-get install binfmt-support qemu qemu-user-static debootstrap kpartx lvm2 dosfstools"
# run with "sudo bootstrap.sh /dev/sd[x]"
echo "Use like: sudo bootstrap.sh /dev/sd[x]"
#deb_mirror="http://ftp.debian.org/debian"
#deb_local_mirror="http://ftp.debian.org/debian"
@pascalpoitras
pascalpoitras / config.md
Last active July 18, 2024 22:34
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@oprypin
oprypin / diffcolor.py
Last active October 22, 2023 01:34
Diffs with syntax highlight
import difflib
import pygments
import pygments.lexers
import pygments.formatters
def read_file(fn):
with open(fn) as f:
return f.read()
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@anthonysterling
anthonysterling / Vagrantfile
Last active April 29, 2020 15:28
Handy Vagrantfile for IE testing with Vagrant.
# Usage: IE={box} vagrant up
#
# Eg. IE=XPIE6 vagrant up
boxes = {
"XPIE6" => "http://aka.ms/vagrant-xp-ie6",
"XPIE8" => "http://aka.ms/vagrant-xp-ie8",
"VistaIE7" => "http://aka.ms/vagrant-vista-ie7",
"Win7IE8" => "http://aka.ms/vagrant-win7-ie8",
"Win7IE9" => "http://aka.ms/vagrant-win7-ie9",
@davidbgk
davidbgk / visio.md
Last active October 25, 2016 18:41
Visioconférences à plus de 3

Visioconférences à plus de 3

  • établir le périmètre avant (sujets/personnes concernées)
  • désactiver la vidéo et le micro par défaut après avoir vu tout le monde en intro et avant que tous les ventilos ne s’emballent (ça demande d’avoir une bonne persistance rétinienne quand on parle dans le vide 😁)
  • activer la vidéo pour montrer que l’on souhaite parler ensuite
  • activer le micro le temps de prendre la parole seulement. Pro-tip : la touche M permet de le faire au clavier sur appear.in et encore mieux utiliser une app dédiée qui consiste à appuyer sur une touche pour activer le micro !
  • éviter les bruits parasites le plus possible, notamment toute action proche du micro (tripatouiller un truc machinalement, conversation au bureau d’à côté, chat/enfant qui miaule 😼, se gratter la barbe avec son fil d’écouteurs/micro)
  • terminer sur date/horaire du point suivant ?
  • mentionner explicitement lorsque le sujet change et que les participa
@Skyross
Skyross / task_with_lock.py
Last active February 5, 2024 05:51
Celery Task with lock
from celery import Task
from django.conf import settings
from django.core.cache import caches
from celery.utils.log import get_task_logger
logger = get_task_logger(__name__)
# noinspection PyAbstractClass
class TaskWithLock(Task):
"""