Skip to content

Instantly share code, notes, and snippets.

View cliss's full-sized avatar

Casey Liss cliss

View GitHub Profile
@cliss
cliss / gist:2954118
Created June 19, 2012 13:19
June 2012 MacBook Options
+---------------+------------------+------------------+------------------------+
| | 13" MacBook Air | 15" MacBook Pro | 15" Retina MacBook Pro |
| | $2199 | $2999 | $2999 |
+---------------+------------------+------------------+------------------------+
| CPU | 2.0 Dual Core i7 | 2.3 Quad Core i7 | 2.6 Quad Core i7 |
| RAM | 8 GB | 8 GB | 16 GB |
| HD Size/Style | 512 GB SSD | 512 GB SSD | 512 GB SSD |
| Display Res | 1440x900 | 1680x1050 | 1440x900 effective |
| | | | 2880x1800 actual |
| Availability* | Now | Now | 3-4 weeks |
@cliss
cliss / gist:2959813
Created June 20, 2012 13:07
2012 MacBook Options on $2700 Budget
+---------------+--------------------------+-------------------------+------------------------+
| | 13" MacBook Air | 15" MacBook Pro | 15" Retina MacBook Pro |
| | $2450 | $2790 | $2750 |
+===============+==========================+=========================+========================+
| CPU | 2.0 Dual Core i7 $1500 | 2.3 Quad Core i7 $1800 | 2.3 Quad Core i7 $2200 |
+---------------+--------------------------+-------------------------+------------------------+
| RAM | 8 GB $100 | 16 GB (OWC) $170 | 16 GB $200 |
+---------------+--------------------------+-------------------------+------------------------+
| HD Size/Style | 512 GB SSD $500 | 120 GB SSD (OWC) $140 | 256 GB SSD |
| | | 750 GB 7200 RPM $150 | |
@cliss
cliss / NSURL+QueryAttributes.m
Created June 29, 2012 12:05 — forked from AdamSwinden/NSURL+QueryAttributes.m
NSURL Query Attributes
//
// NSURL+QueryAttributes.m
//
// Created by Adam Swinden on 29/06/2012.
// Copyright (c) 2012 The OTHER Media. All rights reserved.
//
#import "NSURL+QueryAttributes.h"
@implementation NSURL (QueryAttributes)
@cliss
cliss / mtnlion.sh
Created July 25, 2012 11:26
Mountain Lion Availability Checker
#!/bin/sh
#
# Modified source from here: http://pastie.org/4328940
# As linked to from here: http://www.tuaw.com/2012/07/24/maniacally-cuckoo-for-mountain-lion-app-store-checker-shell-scr/
#
# REQUIRES growl notify, available here: http://growl.info/downloads
#
##########################################
URL='http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewMultiRoom?fcId=489264329&mt=12'
@cliss
cliss / ParseOrDefault.cs
Last active October 11, 2015 07:07
ParseOrDefault<T>
#region Fields
private static Dictionary<Type, MethodInfo> _tryParseMethods = new Dictionary<Type, MethodInfo>();
#endregion Fields
#region Methods
/// <summary>
/// Invokes a TryParse(string, out T) method on the given input.
@cliss
cliss / gist:4505625
Last active December 10, 2015 22:58 — forked from twobitlabs/gist:4226365
// block typedef:
typedef void(^Block)();
typedef void(^ConditionalBlock)(BOOL);
typedef NSString*(^BlockThatReturnsString)();
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL);
// block property with typedef:
@property(copy)Block theBlock;
@cliss
cliss / NSArray+CLinq.h
Last active December 11, 2015 00:39
NSArray category that extends it with abilities inspired by Microsoft LINQ. See Readme.md below. Update 13/1/13: Heavily modified as per @jamiepinkham's recommendations. Thanks!
//
// NSArray+CLinq.h
//
// Created by Casey Liss on 12/1/13.
// Copyright (c) 2013 Casey Liss. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef id(^CLSelector)(id source);
@cliss
cliss / gist:5374387
Last active November 27, 2019 19:06
Best of Top Gear
+----------------------------------------------+
| Series | Episode | Description |
+--------+---------+---------------------------+
| 5 | 5 | Jaguar at the Nurburgring |
| 5 | 8 | Race to Verbier |
| 8 | 0 | Winter Olympics Special |
| 8 | 3 | Amphibious Cars |
| 8 | 6 | Caravan Vacation |
| 9 | 3 | America Special |
| 10 | 0 | Polar Special |
@cliss
cliss / CarouselItem.cs
Created August 2, 2013 13:39
Example of a C# class, CarouselItem, that uses attributes to decorate fields/ivars and also properties. The attribute is Column, which corresponds to a custom class I wrote which is called ColumnAttribute (convention dictates this), which is shown below as well.
[XmlRoot(ElementName="Item")]
public class CarouselItem
{
#region Fields
#pragma warning disable 649
[Column("URL")]
private string _url;
@cliss
cliss / organize-photos.py
Created October 6, 2013 14:43
Photo management script. This script will copy photos from "~/Pictures/iPhone Incoming" into a tree the script creates, with folders representing month and years, and photo names timestamped. Completely based on the work of the amazing Dr. Drang; see here: http://www.leancrew.com/all-this/2013/10/photo-management-via-the-finder/ You can see more…
#!/usr/bin/python
import sys
import os, shutil
import subprocess
import os.path
from datetime import datetime
######################## Functions #########################