Skip to content

Instantly share code, notes, and snippets.

View command-tab's full-sized avatar

Collin Allen command-tab

View GitHub Profile
@tuananh
tuananh / archive.html
Created November 12, 2013 15:16
Group posts by month in Jekyll archive page
---
layout: default
title: Archive
---
<div class="post">
<h2>Archive</h2>
<ul>
{% for post in site.posts %}
{% unless post.next %}
@lisamelton
lisamelton / transcode-video.sh
Last active May 24, 2024 17:42
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 5.13 of April 8, 2015
@landonf
landonf / strongtalk.md
Last active August 3, 2024 13:30
A brief list of Strongtalk papers

In considering where Objective-C could go, it's worthwhile to start by understanding the work that's already been done.

Below are a selection of papers from Gilad Bracha's 1990s work on Strongtalk, an extension of Smalltalk (from which Objective-C's design derives) with (among other things), stronger type-safety tooling.

What's interesting (to me, anyway), is that the work done on the Self/Strongtalk VM in the early 90s was actually bought by Sun and became the modern Java VM. When Google got started on their V8 JavaScript runtime, guess who shows up again — Lars Bak, who was the technical lead for both the Strongtalk and HotSpot Java VMs.

If we're going to be talking about how to apply "modern" (1990s!) ideas to Objective-C, we'd be wise to review the considerable work done in considering those sorts of problems in a Smalltalk-derived universe, and lifting whatever good ideas we can, and discarding

@hsiboy
hsiboy / wiegand.c
Created March 17, 2014 12:59
Wiegand API for Raspberry Pi
/*
* Wiegand API Raspberry Pi
* By Kyle Mallory All rights reserved.
* 12/01/2013
* Based on previous code by Daniel Smith (www.pagemac.com) and Ben Kent (www.pidoorman.com)
* Depends on the wiringPi library by Gordon Henterson: https://projects.drogon.net/raspberry-pi/wiringpi/
*
* This is linked with -lpthread -lwiringPi -lrt
*
* The Wiegand interface has two data lines, DATA0 and DATA1. These lines are normall held
@levinunnink
levinunnink / NSImage+Retina.h
Created April 2, 2014 17:02
NSImage retina detection category
//
// NSImage+Retina.h
//
// Created by Levi Nunnink on 3/11/14.
//
#import <Cocoa/Cocoa.h>
@interface NSImage (Retina)
@marcoarment
marcoarment / ATPLogoView.m
Created April 29, 2014 21:07
Source for the Accidental Tech Podcast (ATP) T-Shirt
// Source for the Accidental Tech Podcast (ATP) T-Shirt:
// http://www.marco.org/2014/04/29/atp-shirts
//
// By Marco Arment, April 28, 2014. MIT license.
@implementation ATPLogoView
- (void)drawRect:(CGRect)rectIgnored
{
NSString *fontName = @"MyriadPro-Semibold";
// Playground - noun: a place where people can play
import Cocoa
struct Regex {
let pattern: String
let expressionOptions: NSRegularExpressionOptions
let matchingOptions: NSMatchingOptions
init(pattern: String, expressionOptions: NSRegularExpressionOptions, matchingOptions: NSMatchingOptions) {
@0xced
0xced / uncruftapidiff.m
Created June 18, 2014 22:17
Uncruft iOS 8.0 and OS X 10.10 API diffs
//
// Copyright (c) 2014 Cédric Luthi “0xced”
//
// ./uncruftapidiff https://developer.apple.com/library/prerelease/ios/releasenotes/General/iOS80APIDiffs/index.html iOS8_0APIDiffs.html
// ./uncruftapidiff https://developer.apple.com/library/prerelease/mac/documentation/General/Reference/APIDiffsMacOSX10_10SeedDiff/index.html OSX10_10APIDiffs.html
//
#import <Foundation/Foundation.h>
#import <sysexits.h>
@lausdahl
lausdahl / git-extract-subdir.md
Last active May 18, 2022 22:02
How to Extract a Subdirectory as a New git Repository
# 1. Clone the remote 
git clone monster-repository project-repository

# 2. change dir
cd project-repository

# 3. Remove the remote
git remote rm origin
@jpmens
jpmens / codesign.md
Last active April 21, 2023 17:14
Code signing on OS/X to disable pesky "do you want to allow incoming connections" after every damn make

I called my certificate OTrecorderSign

Sign

$ vi *.c
$ make
$ codesign -f -s OTrecorderSign myprog