Skip to content

Instantly share code, notes, and snippets.

View joshdick's full-sized avatar
💭
😋

Josh Dick joshdick

💭
😋
View GitHub Profile
@somic
somic / udp_hole_punch_tester.py
Created November 3, 2009 04:13
UDP Hole Punching test tool
#!/usr/bin/env python
#
# udp_hole_punch_tester.py - UDP Hole Punching test tool
#
# Usage: udp_hole_punch_tester.py remote_host remote_port
#
# Run this script simultaneously on 2 hosts to test if they can punch
# a UDP hole to each other.
#
# * remote_port should be identical on 2 hosts.
@thelibrarian
thelibrarian / Wombat.tmtheme
Created February 15, 2010 23:46
Wombat theme for TextMate, based on the original Vim theme (http://dengmao.wordpress.com/2007/01/22/vim-color-scheme-wombat/)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>author</key>
<string>Lars H. Nielsen (translated by Tony Kemp)</string>
<key>name</key>
<string>Wombat</string>
<key>settings</key>
<array>
@unruthless
unruthless / CSS for <sup> and <sub>
Created May 26, 2010 01:31
CSS for <sub> and <sup>
sub, sup {
/* Specified in % so that the sup/sup is the
right size relative to the surrounding text */
font-size: 75%;
/* Zero out the line-height so that it doesn't
interfere with the positioning that follows */
line-height: 0;
/* Where the magic happens: makes all browsers position
@MicahElliott
MicahElliott / colortrans.py
Created November 29, 2010 07:57
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
@Kilian
Kilian / annoying.js
Created January 6, 2011 15:04
How to be an asshole
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*
@jcromartie
jcromartie / git-merged.rb
Created March 29, 2011 18:47
Git command to list merged (or unmerged with -u) branches
#!/bin/ruby
show_unmerged = ARGV[0] == '-u'
branches = `git branch -r`.split("\n")
branches.each do |branch|
is_merged = `git branch --contains #{branch}` =~ /master/
puts branch if show_unmerged ^ is_merged
end
@nathansmith
nathansmith / screwed.js
Last active June 10, 2020 17:01
Force yourself to learn JavaScript.
// If you're a glutton for punishment, and/or claim
// that JavaScript libraries have too much "bloat",
// use this to force yourself to write JS longhand.
(function(window) {
function screwed() {
window._ = null;
window.$ = null;
window.$A = null;
window.$F = null;
@Yaffle
Yaffle / URLUtils.js
Last active September 5, 2022 02:19
parse URL + absolutize URL in javascript (URLUtils shim - http://url.spec.whatwg.org/#url)
/*jslint regexp: true, maxerr: 50, indent: 2 */
(function (global) {
"use strict";
function URLUtils(url, baseURL) {
var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
if (!m) {
throw new RangeError();
}
@sontek
sontek / snowjob.sh
Last active April 5, 2024 06:51
Make your terminal snow
#!/bin/bash
LINES=$(tput lines)
COLUMNS=$(tput cols)
declare -A snowflakes
declare -A lastflakes
clear
@mislav
mislav / aprompt.png
Last active February 11, 2024 06:40
My zsh prompt. No oh-my-zsh needed
aprompt.png