Skip to content

Instantly share code, notes, and snippets.

from collections import defaultdict
tasks = defaultdict(list)
for line in open('day7.txt'):
components = line.split(' ')
dep, task = components[1], components[7]
tasks[task].append(dep)
if dep not in tasks: tasks[dep] = []
result = ''
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
int main (int argc, char *argv[]) {
if (argc < 2) {
fprintf(stderr, "Usage: %s word\n", argv[0]);
return 1;
}
@cspickert
cspickert / Box.m
Last active August 29, 2015 14:22
#import <Foundation/Foundation.h>
@interface Box<__covariant T: __kindof NSObject *> : NSObject
@property (nonatomic, readonly) __nonnull T value;
- (nonnull instancetype)initWithValue:(nonnull T)value;
@end

Keybase proof

I hereby claim:

  • I am cspickert on github.
  • I am cameronspickert (https://keybase.io/cameronspickert) on keybase.
  • I have a public key whose fingerprint is 4284 AF88 B89B 5D4A 0AE2 E76F 13E4 E728 4469 3DCC

To claim this, I am signing this object:

//
// SAMTextViewTests.m
// SAMTextViewTests
//
// Created by Cameron Spickert on 3/16/14.
// Copyright (c) 2014 Cameron Spickert. All rights reserved.
//
#import <XCTest/XCTest.h>
#import <SAMTextView/SAMTextView.h>
/**
To build (after building ReactiveCocoa):
$ clang -framework Foundation \
-framework AppKit \
-I./ReactiveCocoa/ReactiveCocoaFramework/build/Release/include/ReactiveCocoa-Mac \
-L./ReactiveCocoa/ReactiveCocoaFramework/build/Release \
-lReactiveCocoa-Mac \
-ObjC \
-g -o main chunks.m
# Remove 64-bit build architecture from Pods targets
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |configuration|
target.build_settings(configuration.name).delete 'ARCHS'
end
end
end
------------------------------------------------------------
/Users/cameron/Documents/Development/oyster-api/venv/bin/pip run on Fri Nov 8 13:57:35 2013
Downloading/unpacking git+git://github.com/oysterbooks/oyster-django-tastypie.git@f7ffbf38c5d68edc10845b3be8f798e54d1ec62b (from -r requirements/base.txt (line 74))
Cloning git://github.com/oysterbooks/oyster-django-tastypie.git (to f7ffbf38c5d68edc10845b3be8f798e54d1ec62b) to /var/folders/xc/kd8mgzfd5d9c4215hfm69pph0000gn/T/pip-I_X9Jx-build
Found command 'git' at '/usr/local/bin/git'
Running command /usr/local/bin/git clone -q git://github.com/oysterbooks/oyster-django-tastypie.git /var/folders/xc/kd8mgzfd5d9c4215hfm69pph0000gn/T/pip-I_X9Jx-build
Running command /usr/local/bin/git show-ref
f7ffbf38c5d68edc10845b3be8f798e54d1ec62b refs/heads/master
@cspickert
cspickert / word_frequency.py
Last active December 16, 2015 02:09
Plot word frequency over time in a git repo's commit messages using matplotlib.
#!/usr/bin/python
"""
Plot the frequency of the given words in the commit messages of a git repository.
Usage: python word_frequency.py git_dir word1 [word2...]
Example: python word_frequency.py /path/to/repo/.git fix add remove
"""
import sys
import datetime
@cspickert
cspickert / mimetype.py
Created March 19, 2013 19:58
A quick command line tool for determining the MIME type of a local file as returned by NSURLConnection. Requires Mac OS X.
#!/usr/bin/python
from Foundation import *
def MIMETypeForFileAtPath(path):
url = NSURL.fileURLWithPath_(path)
request = NSURLRequest.requestWithURL_(url)
data, response, error = NSURLConnection.sendSynchronousRequest_returningResponse_error_(request, None, None)
return response.MIMEType()