This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LeafletJSONField(JSONField): | |
widget = LeafletWidget(width='100%', height='400px') | |
def process_formdata(self, valuelist): | |
if valuelist: | |
value = valuelist[0] | |
if not value: | |
self.data = None | |
return | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Make a gif from a video using optimized palette | |
# | |
# Usage: make-gif video.mov video.gif 200 | |
# | |
# Will output a gif with width 200px | |
# You can use iw in the width expression to have the width of the input | |
# video : iw*0.5 will make the gif half the size of the video (useful | |
# for Retina displays) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import defaultdict | |
from xml.etree import cElementTree as ET | |
def etree_to_dict(t): | |
# remove namespace | |
if hasattr(t.tag, 'find'): | |
i = t.tag.find('}') | |
if i >= 0: | |
t.tag = t.tag[i+1:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var url = require('url'); | |
var SockJS = require("sockjs-client"); | |
var stripAnsi = require('strip-ansi'); | |
var scriptElements = document.getElementsByTagName("script"); | |
var scriptHost = scriptElements[scriptElements.length-1].getAttribute("src").replace(/\/[^\/]+$/, ""); | |
// If this bundle is inlined, use the resource query to get the correct url. | |
// Else, get the url from the <script> this file was called with. | |
var urlParts; | |
if (typeof __resourceQuery === "string" && __resourceQuery) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Ornikar Keyboard Shortcuts | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Add ABCD shortcuts to Ornikar questions | |
// @author Patrick Browne | |
// @match https://www.ornikar.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_id": "568e49392da99e28c3842b14", | |
"archived": false, | |
"arrival": [ | |
5.378861000000001, | |
43.2942346 | |
], | |
"custom": false, | |
"departure": [ | |
5.386108399999999, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import pprint | |
import requests | |
TRIMMABLE_HEADERS = [ | |
'Accept', | |
'Host', | |
'Origin', | |
'Accept-Encoding', | |
'Accept-Language', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Sequence Diagram in Github | |
// @version 0.1 | |
// @description Use https://github.com/bramp/js-sequence-diagrams to put sequence diagrams in Github | |
// @match https://github.com/*/*/issues/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.2.1/lodash.min.js | |
// @run-at document-end | |
// example in Github Issues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 0 is too far from ` ;) | |
set -g base-index 1 | |
set-window-option -g pane-base-index 1 | |
# No confirm before kill | |
bind-key x kill-pane | |
# Use ` as prefix | |
unbind C-b | |
set -g prefix ` |