Skip to content

Instantly share code, notes, and snippets.

matthewmueller /
Last active Nov 18, 2020
OSX for Hackers (Mavericks/Yosemite)
# OSX for Hackers (Mavericks/Yosemite)
# Source:
# Some things taken from here
# Ask for the administrator password upfront
jkubicek / birds.txt
Last active Aug 29, 2015
Print the names of all the birds
View birds.txt
Striated Pardalote
Elegant Crested Tinamou
Little Tinamou
Slaty-breasted Tinamou
Thicket Tinamou
Great Tinamou
Chilean Tinamou
Cinereous Tinamou
Brown Tinamou
Greater Rhea
View ATPLogoView.swift
// Source for the Accidental Tech Podcast (ATP) T-Shirt:
// By Troy Gaul, June 2, 2014.
// Based on Obj-C veresion by Marco Arment, April 28, 2014. MIT license.
import UIKit
mantonaci / gist:10731724
Created Apr 15, 2014
Convert byte array to base64 string
View gist:10731724
var i2a = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'];
exports.base64_encode = function(s) {
var length = s.length;
var groupCount = Math.floor(length / 3);
var remaining = length - 3 * groupCount;
var result = "";
var idx = 0;
for (var i = 0; i < groupCount; i++) {
gruber / Liberal Regex Pattern for Web URLs
Last active Nov 17, 2020
Liberal, Accurate Regex Pattern for Matching Web URLs
View Liberal Regex Pattern for Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "". For a pattern that attempts to
match all URLs, regardless of protocol, see:
# Single-line version:
brentsimmons / gist:5810992
Last active Oct 19, 2020
Detect a tap on a URL inside a UITextView. Note: the rs_links method isn't included -- you'll need something that takes text and returns an array of detected links. This gist just demonstrates walking through the UITextView characters.
View gist:5810992
@implementation UITextView (RSExtras)
static BOOL stringCharacterIsAllowedAsPartOfLink(NSString *s) {
/*[s length] is assumed to be 0 or 1. s may be nil.
Totally not a strict check.*/
if (s == nil || [s length] < 1)
return NO;
marcoarment / gist:5393014
Created Apr 16, 2013
Simple script to fetch Libsyn podcast download totals and display them in Panic's Status Board app.
View gist:5393014
$graph_title = 'Downloads By Episode';
$libsyn_show_id = 12345; // Find this in the various URLs in your control panel
$libsyn_credentials = array(
'email' => '',
'password' => 'your libsyn password'
$most_recent_episodes_to_include = 5;
function csv_with_headers_to_array($csv_str)
brandonb927 /
Last active Nov 26, 2020
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.
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see
# Alot of these configs have been taken from the various places
# on the web, most from here
View gist:3056322
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[JBViewController alloc] initWithNibName:@"JBViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window setTransform:CGAffineTransformMakeScale(0.81, 0.81)];
marcoarment / IPInsetLabel.h
Created May 4, 2012
IPInsetLabel: a simple UILabel subclass that adds padding insets and auto-height-resizing
View IPInsetLabel.h
// IPInsetLabel.h
// Instapaper
// Created by Marco Arment on 7/23/11.
// Copyright 2011 Instapaper LLC, released to the public domain.
#import <UIKit/UIKit.h>
You can’t perform that action at this time.