Skip to content

Instantly share code, notes, and snippets.

jedi4ever / dpkg-gnutar
Created Mar 17, 2011
homebrew formula to get dpkg working a mac
View dpkg-gnutar
require 'formula'
class Tar <Formula
url ''
homepage ''
md5 '00d1e769c6af702c542cca54b728920d'
# depends_on 'cmake'
def install
ScottPhillips / .htaccess
Created Feb 2, 2012
Common .htaccess Redirects
View .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php
#Redirect an entire site:
Redirect 301 /
#Redirect an entire site to a sub folder
Redirect 301 /
ndbroadbent / gist:3030358
Created Jul 2, 2012
Tiny Umbrella Crash
View gist:3030358
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: com/sun/jna/Platform
at com.semaphore.os.UIHandlerManager.getSystemUIHandler(
at com.semaphore.TinyUmbrella.<clinit>(
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.semaphore.TinyLoader.loadTiny(
at com.semaphore.TinyLoader.access$000(
at com.semaphore.TinyLoader$
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
chasereeves / gist:3124135
Created Jul 16, 2012
Wordpres Custom Menu/Navigation Walker - remove all list items from menu, only links remain.
View gist:3124135
//========================================================== CUSTOM MENU WALKER - remove list stuff, only links
class custom_menu_walker_remove_list extends Walker_Nav_Menu {
function start_el(&$output, $item, $depth, $args) {
global $wp_query;
$class_names = $value = '';
$classes = empty( $item->classes ) ? array() : (array) $item->classes;
$classes[] = 'menu-item-' . $item->ID;
$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
$class_names = ' class="' . esc_attr( $class_names ) . '"';
$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
davatron5000 / Sublime Text
Last active Sep 1, 2021
A new user's guide to SublimeText 2. Estimated reading time: 2 mins. Estimated workthrough time: 12 minutes.
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.

maxfenton /
Last active Dec 3, 2021
System setup stuff for a new mac

New computer setup

a/o 2020-05-29


Format the drive

  1. Restart with Cmd-R or Cmd-D
  2. Erase drive / 3x if second-hand
  3. Reinstall MacOS
arigesher / responsive-flickr-embeds
Last active Oct 26, 2020
JQuery code to make Flickr embeds responsive (and resize correctly when loading in a mobile browser). See for a working example.
View responsive-flickr-embeds
$(document).ready(function() {
$("#pics iframe").each(function(index) {
var ratio = $(this).height() / $(this).width();
var origHeight = $(this).height();
var origWidth = $(this).width();
var self = this;
// bind to window with closure that references the
// iframe since the iframe doesn't get resize events
// until (you know) we resize it.
$(window).resize(function() {
Chaser324 /
Last active Dec 8, 2021
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

kyledrake / ferengi-plan.txt
Last active Jul 12, 2021
How to throttle the FCC to dial up modem speeds on your website using Nginx
View ferengi-plan.txt
# The blog post that started it all:
# Current known FCC address ranges:
# Confirm/locate FCC IP ranges with this:
# In your nginx.conf:
location / {
nderkach /
Last active May 13, 2020
How to record iOS screen and share it on github

Record a screencast with QuickTime Player

  1. Connect an iOS defice with a cable
  2. In QuickTime Player: Option-Cmd-N (New Movie Recording) -> Select your device from the recording menu:

Install gifify