Skip to content

Instantly share code, notes, and snippets.

@jasonwryan
jasonwryan / tunnels
Last active August 29, 2015 14:01
Manage SSH proxy tunnels to a number of hosts
#!/usr/bin/env bash
# tunnel browser to another box
# Copyright (c) 2013 Jason W Ryan
# The MIT License (MIT) http://opensource.org/licenses/MIT
user="<your_name>"
exip="XXX.XXX.XXX.XXX"
tunnel_id="$HOME/.local/tmp/tunnel_id"
@Reiot
Reiot / wordpress2octopress.py
Created September 24, 2011 14:21
Wordpress.com xml ==> octopress markdown migration script
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import sys
import os
import re
import yaml
import urllib
import codecs
from datetime import datetime
from BeautifulSoup import BeautifulStoneSoup, Comment
@nvie
nvie / ormtools.py
Created November 29, 2013 08:59
Really useful helper that I use constantly to force myself to write more efficient Django queries.
from contextlib import contextmanager
from django.conf import settings
from django.db import connection
@contextmanager
def no_queries_allowed():
"""This is a helper method that makes it easier during development, by
throwing an exception when any queries are made within its block. Using
@jeremygibbs
jeremygibbs / wp2sc.py
Created January 31, 2012 10:22 — forked from Reiot/wordpress2octopress.py
WordPress XML ==> Second Crack Markdown
#!/usr/bin/env python
#######################################################
# File: wp2sc.py #
# Date: 31 January 2011 #
# Auth: Jeremy A. Gibbs #
# Depn: Requires BeautifulSoup and html2text #
# Desc: This script reads in a Wordpress .xml export #
# file and converts the contents into markdown #
# formatted files suitable to import into #
# Marco Arment's Second Crack static blogging #
@bminer
bminer / changeTypeAttr.js
Created August 31, 2012 21:30
Cross-browser solution for changing the 'type' attribute of an `<input/>` tag.
/* x is the <input/> element
type is the type you want to change it to.
jQuery is required and assumed to be the "$" variable */
function changeType(x, type) {
if(x.prop('type') == type)
return x; //That was easy.
try {
return x.prop('type', type); //Stupid IE security will not allow this
} catch(e) {
//Try re-creating the element (yep... this sucks)
@bcicen
bcicen / somacli.sh
Last active March 8, 2019 18:01
somacli
#!/bin/bash
baseurl="http://somafm.com"
tmpdir="/tmp/"
boldtext=`tput bold`
normaltext=`tput sgr0`
WGET="/usr/bin/wget"
MPLAYER="/usr/bin/mplayer"
stationnames=("Christmas Rocks!" "Christmas Lounge" "Xmas in Frisko (holiday)" "Groove Salad (ambient/electronica)" "Lush (electronica)" "Earwaves (experimental)" "Deep Space One (ambient)" "Drone Zone (ambient)" "PopTron (alternative)" "DEF CON Radio (specials)" "Dub Step Beyond (electronica)" "Space Station Soma (electronica)" "Mission Control (ambient/electronica)" "Indie Pop Rocks! (alternative)" "Folk Forward (folk/alternative)" "BAGeL Radio (alternative)" "Digitalis (electronica/alternative)" "Sonic Universe (jazz)" "Secret Agent (lounge)" "Suburbs of Goa (world)" "Boot Liquor (americana)" "Illinois Street Lounge (lounge)" "The Trip (electronica)" "cliqhop idm (electronica)" "Iceland Airwaves (alternative)" "Covers (eclectic)" "Underground 80s (alternative/electronica)" "Beat Blender (electronica)" "Doomed (ambient/industrial)" "Black Rock FM (eclectic)" "SF
@tfnico
tfnico / git-developers.md
Last active December 22, 2021 13:59
When and how to contact the Git developers

Before you send an email to the Git developers' mailing list

If you are a normal Git user, and you have problems using Git, you can also try:

If you believe you've found a bug in Git for Windows or msysGit (Windows-specific), first check their issue tracker to see if the problem has already been reported. If not, send a message to msysgit@googlegroups.com or visit the online forum version.

@wilbowma
wilbowma / jail.pl
Last active August 1, 2022 11:16
A perl script to create nginx chroot in arch linux.
#a/usr/bin/perl
# This script was hastily cobbled together for my own use. It can
# probably break your system. Use at your own risk.
$JAIL = "/srv/http";
$USER = "http";
$GROUP = "http";
$WWW_DIR = "www";
sub run{
@necolas
necolas / snippet.js
Created June 14, 2011 20:36
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@swarminglogic
swarminglogic / watchfile.sh
Last active March 4, 2024 14:44
watchfile - monitor file(s) and execute a command when files are changed
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------