Skip to content

Instantly share code, notes, and snippets.

(╯°□°)╯︵ ┻━┻

David Larlet davidbgk

(╯°□°)╯︵ ┻━┻
View GitHub Profile
davidbgk / 404checker.js
Last active Aug 27, 2015 — forked from n1k0/404checker.js
A CasperJS script to check for 404 & 500 internal links on a given website
View 404checker.js
* This casper scipt checks for 404 internal links for a given root url.
* Usage:
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
/*global URI*/
View Liberal Regex Pattern for URLs
# Single-line version:
# Commented multi-line version:
( # Capture 1: entire matched URL
View Sublime Text

Make it useful

  • Install Package Control. For SublimeText 2, paste the following in Terminal:
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( '' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')

From here on out, use Package Control to install everything. +Shift+P, then type Install to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.

View gist:9084540

Virtualenv's bin/activate is Doing It Wrong

I'm a Python programmer and frequently work with the excellent [virtualenv][] tool by Ian Bicking.

Virtualenv is a great tool on the whole but there is one glaring problem: the activate script that virtualenv provides as a convenience to enable its functionality requires you to source it with your shell to invoke it. The activate script sets some environment variables in your current environment and defines for you a deactivate shell function which will (attempt to) help you to undo those changes later.

This pattern is abhorrently wrong and un-unix-y. activate should instead do what ssh-agent does, and launch a sub-shell or sub-command with a modified environment.


View postforms.js
Show a progress element for any form submission via POST.
Prevent the form element from being submitted twice.
(function (win, doc) {
'use strict';
if (!doc.querySelectorAll || !win.addEventListener) {
// doesn't cut the mustard.
View gist:9538873
<style type="text/css">
table table {
width: 600px !important;
table div + div { /* main content */
width: 65%;
float: left;
# A guide to prevent pain and suffering while upgrading to OS X Mavericks
# This will vary greatly depending on system set up, so read the instructions carefully
# Back up Virtulenvs
# Very important!
# For each virtualenv you have, run "pip freeze > requirements.txt" while in the activated virtualenv
# in order to prevent loss of dependencies during the upgrade.
View Contract Killer

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post


a simple git branching model

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

The gist

View gist:10143813
#!/usr/bin/env python
# Quick and dirty demonstration of CVE-2014-0160 by
# Jared Stafford (
# Modified so that it finds cookies
import sys
import struct
import socket
import time
import select
You can’t perform that action at this time.