Skip to content

Instantly share code, notes, and snippets.

@syoutsey
syoutsey / gist:5060186
Created February 28, 2013 21:15
Get full timestamp (HH:MM:SS) from input (MM:SS, H:MM:SS, H:M:S, etc.)
#!/bin/bash
cat $1 |
while read cnt tm; do
cnt=$((cnt-1))
IFS='.' read -a a <<< "$tm"
MVAR=0
SVAR=1
HOUR=00
# check if string has hours included (ex: 01:23:45)
if [ -n "${a[2]}" ]; then
@syoutsey
syoutsey / SecretSantaSort.swift
Created October 21, 2015 17:19
Implementation of Secret Santa sort
/*
Small program written to automate the sorting of Secret Santas as initially brought to my attention by Brent Simmons (http://inessential.com/2015/09/25/a_secret_santa_solution).
*/
import Foundation
let DEBUG = false
class Person: Equatable {
var first: String
@syoutsey
syoutsey / gist:3c092de1f7fbba14945b
Last active August 29, 2015 14:18
Slow Cooker Pulled Pork

Pulled Pork

Ingredients

  1. 3-4lbs pork shoulder
  2. 1 onion, chopped
  3. 1 (16oz) bottle BBQ sauce
  4. 1/2cup sriracha
  5. salt
  6. pepper
@syoutsey
syoutsey / gist:2154d72338394bb08222
Created January 14, 2015 02:06
Swift Compiler Choke
#! /usr/bin/env xcrun swiftc
println("Hello, world!")
var data = [["hello" : "world"],
["hello" : "world"],
["hello" : "world"],
["hello" : "world"],
["hello" : "world"],
["hello" : "world"],
.section __TEXT,__text,regular,pure_instructions
.align 4, 0x90
_top_level_code:
.cfi_startproc
pushq %rbp
Ltmp3:
.cfi_def_cfa_offset 16
Ltmp4:
.cfi_offset %rbp, -16
movq %rsp, %rbp