Skip to content

Instantly share code, notes, and snippets.

View pstadler's full-sized avatar

Patrick Stadler pstadler

View GitHub Profile
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@nanoant
nanoant / sidebar.m
Created September 27, 2011 10:52
Change your Lion sidebar item icons
// (l) copyleft 2011 Adam Strzelecki nanoant.com
//
// Usage:
// sidebar - to see the ids of your favorite sidebar items
// sidebar ItemName - to remove item specific icon
// sidebar ItemName sbBj - to set specific item icon, see:
// /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist
// Compile it with:
// gcc -o sidebar sidebar.m -F /Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks -framework Foundation -framework CoreServices
//
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active May 29, 2024 14:52
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@pstadler
pstadler / ej.sh
Created October 19, 2012 13:03
ejabberd control script
function ej {
EJABBERD_HOME=/usr/local/ejabberd-commercial
EJABBERD_CTL=$EJABBERD_HOME/sbin/ejabberdctl
case "$1" in
restart)
$EJABBERD_CTL stop && $EJABBERD_CTL stopped; $EJABBERD_CTL start
;;
reload)
$EJABBERD_CTL update $2
@kwylez
kwylez / gist:5337918
Last active March 2, 2020 06:09
Example implementation of listening for iTunes/Spotify track changes and displaying information in the NotificationCenter. Article reference: http://blog.corywiles.com/now-playing-with-spotify-and-itunes
//
// AppDelegate.m
//
//
// Created by Cory D. Wiles on 10/8/12.
// Copyright (c) 2013 Cory D. Wiles. All rights reserved.
//
#import "AppDelegate.h"
#import "iTunes.h"
@morkeleb
morkeleb / gist:5705647
Created June 4, 2013 12:51
Self documenting api in node.js
app.get('/api/', function(req, res) {
// This endpoint
//returns the routes available in the api
var routes = [];
for(var verb in app.routes){
app.routes[verb].forEach(function(route) {
var doc = route.callbacks[route.callbacks.length-1].toString().split('\n').filter(function(str) {
var doc = str.match(/(?:\s\/\/)(.*)/);
if(doc == null) return false;
return true;

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
@rastating
rastating / USNetflixHosts
Created November 27, 2013 22:04
A hosts file to use to access the US Netflix using the Unblock US service without using their DNS for all of your traffic.
# Hosts file to access US Netflix using Unblock US without their DNS.
67.216.222.61 movies.netflix.com
67.216.222.65 cbp-us.nccp.netflix.com
67.216.222.130 movies1.netflix.com
67.216.222.104 movies2.netflix.com
147.255.171.14 netflix.com
147.255.171.7 moviecontrol.netflix.com
69.197.181.166 api-global.netflix.com
67.216.222.83 api-us.netflix.com
147.255.227.2 api.netflix.com
@mfdj
mfdj / wildcard_ssl_certificate.sh
Last active October 29, 2022 11:08
Bash script that uses openssl to generate a wildcard certificate suitable for use in a local testing environment: not vetted for a production/public internet purposes. Usage: `$ ./wildcard.sh yourdomain.local` — generates a private key, certificate request, and ssl certificate.
#!/usr/bin/env bash
DOMAIN=$1
if [ -z "$DOMAIN" ]; then
echo -n 'Enter root domain (no www): '
read input_d
DOMAIN=$input_d
fi