- Author
Tiago Alves Macambira [tmacam burocarata org]
- Licence
Creative Commons By-SA
Table of Contents
;; joins two consecutives lines like vim's "J" | |
(defun join-lines () | |
(interactive) | |
(save-excursion | |
(end-of-line) | |
(insert-char ? 1) | |
(delete-char 1) | |
(while (looking-at "\\s +") | |
(delete-char 1)))) |
#ifndef PRODUCER_CONSUMER_QUEUE_HPP_ | |
#define PRODUCER_CONSUMER_QUEUE_HPP_ | |
// Based on code from http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html | |
// Original version by Anthony Williams | |
// Modifications by Michael Anderson -- https://gist.github.com/482342 | |
#include <boost/thread.hpp> |
"""Verifies a password's strength by measuring its entropy. | |
Notice that this form of password strength testing does not distinguish easy to | |
guess passwords like "1111...." from supposedly good passwords like "%hF6Nz-0". | |
Some rule/points based passwords tests can and should be used together | |
with this to asset a password's strengh. | |
References: | |
- http://xkcd.com/936/ | |
- http://en.wikipedia.org/wiki/Password_strength |
#!/usr/bin/env python -u | |
# vim:ts=4:sts=4:sw=4:et:wrap:ai:fileencoding=utf-8: | |
"""Decorator to log a function's backtrace to a remote server. | |
Based on client/backtrace.py | |
from http://github.com/tmacam/DistributedCrawler. | |
""" |
#!/usr/bin/env python -u | |
# vim:ts=4:sts=4:sw=4:et:wrap:ai:fileencoding=utf-8: | |
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route('/', methods=['POST', 'GET']) |
if [ "$color_prompt" = yes ]; then | |
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 "\n(%s)")\$ ' | |
else | |
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1 "\n(%s)")\$ ' | |
fi | |
unset color_prompt force_color_prompt |
#!/bin/sh | |
set -e | |
press_enter() { | |
set +x | |
echo "PRESS [ENTER]"; | |
read ENTER; | |
set -x | |
} |
#!/bin/sh | |
set -e | |
BRANCH=${1:?"Usage: $0 [BRANCH]"} | |
if ! ( git branch | grep -q ${BRANCH} ); then | |
echo "ERROR: Uknown branch '${BRANCH}'" > /dev/stderr | |
exit 1 |
#!/usr/bin/python | |
# vim:ts=4:sts=4:sw=4:et:wrap:ai:fileencoding=utf-8: | |
"""A collection of string normalization routines. | |
You are probably looking for normalize_string, that does an aggressive (but | |
arguably sound) string normalization process. | |
""" | |