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 GitLab Draft Comments | |
// @description Alert for and list forgotten GitLab draft comments. | |
// @namespace https://github.com/PiDelport/ | |
// @author Pi Delport <pjdelport@gmail.com> | |
// @version 1.0 | |
// @license MIT | |
// @homepageURL https://gist.github.com/PiDelport/74453fa91872a9e51c7858550ff3cab3 | |
// | |
// @grant GM.registerMenuCommand |
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
# Well-known hosts | |
# https://gist.github.com/PiDelport/8a327a46c4453941bedfea5e8269f980 | |
# https://blog.bitbucket.org/2018/07/02/new-ip-addresses-bitbucket-cloud/ | |
bitbucket.org,18.205.93.0/25,13.52.5.0/25 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw== | |
# GitHub | |
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints | |
# https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-githubs-ip-addresses |
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 namedtuple | |
TOK_TEXT = 'TOK_TEXT' | |
TOK_LEFT_META = 'TOK_LEFT_META' | |
TOK_RIGHT_META = 'TOK_RIGHT_META' | |
TOK_DUMMY = 'TOK_DUMMY' | |
# A token has |
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
-- Sequence a list of Either-yielding monadic actions. | |
-- Sequencing stops on the first Left value, or yields a list successful Right values. | |
sequenceRights :: Monad m => [m (Either e t)] -> m (Either e [t]) | |
sequenceRights [] = pure (pure []) | |
sequenceRights (x:xs) = handle =<< x | |
where | |
handle (Left e) = pure (Left e) | |
handle (Right t) = (t:) <<$>> sequenceRights xs | |
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
;;; Analogous to lambda, but curried. | |
(define-syntax curried | |
(syntax-rules () | |
((curried () body ...) (lambda () body ...)) | |
((curried (arg) body ...) (lambda (arg) body ...)) | |
((curried (arg args ...) body ...) | |
(lambda (arg . rest) | |
(let ((next (curried (args ...) body ...))) | |
(if (null? rest) | |
next |
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 inspect | |
def format_call(func, *positional, **named): | |
_locals = inspect.getcallargs(func, *positional, **named) | |
spec = inspect.getargspec(func) | |
argvalues = inspect.formatargvalues(spec.args, spec.varargs, spec.keywords, _locals) | |
return '{}{}'.format(func.__name__, argvalues) |
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
#!/usr/bin/env python | |
""" | |
Running:: | |
python pkg_tree.py | dot -Txlib | |
Requires `pydot`. | |
""" | |
import pkg_resources |
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 -e | |
dist="tinymce_${1:?}.zip" | |
wget -N "http://github.com/downloads/tinymce/tinymce/$dist" | |
unzip "$dist" | |
rm -r tinymce/examples | |
mv tinymce/changelog.txt tinymce_changelog.txt | |
cp -a tinymce/jscripts/tiny_mce/* js/tinymce/resources |
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
# See http://tox.testrun.org/ | |
# | |
# Supported Python 2.* environments: py{26,27,py}-dj{13,14,dev} | |
# Supported Python 3.* environments: py{31,32}-djdev | |
[tox] | |
minversion = 1.4 | |
envlist = py27-dj14 | |
# envlist = | |
# py26-dj13, py26-dj14, py26-djdev, |
NewerOlder