Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Youtsey syoutsey

View GitHub Profile
@syoutsey
syoutsey / SecretSantaSort.swift
Created Oct 21, 2015
Implementation of Secret Santa sort
View SecretSantaSort.swift
/*
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 Aug 29, 2015
Slow Cooker Pulled Pork
View gist:3c092de1f7fbba14945b

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
View gist:2154d72338394bb08222
#! /usr/bin/env xcrun swiftc
println("Hello, world!")
var data = [["hello" : "world"],
["hello" : "world"],
["hello" : "world"],
["hello" : "world"],
["hello" : "world"],
["hello" : "world"],
View gist:911165ca1dda0d6a00fa
.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
@syoutsey
syoutsey / gist:5060186
Created Feb 28, 2013
Get full timestamp (HH:MM:SS) from input (MM:SS, H:MM:SS, H:M:S, etc.)
View gist:5060186
#!/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
You can’t perform that action at this time.