Skip to content

Instantly share code, notes, and snippets.

View atomkirk's full-sized avatar

Adam Kirk atomkirk

View GitHub Profile
//
// Created by Adam Kirk on 6/22/15.
//
import UIKit
extension UIScrollView {
var contentOffsetX: CGFloat {
get {
//
// Created by Adam Kirk on 6/22/15.
//
import UIKit
extension UIView {
var x: CGFloat {
get {
@atomkirk
atomkirk / kill!!!!.md
Created June 10, 2015 17:41
My favorite way to kill a process with a name

PID=$(ps aux | grep -e 'vagrant' | grep -v grep | awk '{print $2}') && kill -s 9 $PID 2> /dev/null

@atomkirk
atomkirk / PassInError.swift
Last active August 29, 2015 14:22
Pass In Error
// PassInError.swift
// Created by Adam Kirk on 6/6/15.
import Foundation
typealias PassInErrorBlock = (error: NSError) -> Void
class PassInError: NSObject {
dynamic var ref: NSError?
@atomkirk
atomkirk / main.c
Created January 22, 2015 03:51
Simple C Web Server
/* A simple server in the internet domain using TCP
The port number is passed as an argument */
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
@atomkirk
atomkirk / javascript-isEqual.js
Last active August 29, 2015 14:11
unordered javascript object isEqual
// compares two objects deeply ignoring array ordering.
isEqual = function(a, b) {
objectMap = function(obj) {
var map = [];
var queue = [{ key: '', value: obj }];
while (queue.length > 0) {
var current = queue.shift();
var key = current.key;
@atomkirk
atomkirk / pre-commit_audit
Created December 8, 2014 15:36
Pre-commit to audit source for personal code/log statements.
echo "Checking host URL…"
e=$(egrep -r '^\s+?host:.*?localhost:3000.*?$' . 2>/dev/null)
if [ -n "$e" ]; then
echo "You need to change host to heroku."
exit 1
fi

Keybase proof

I hereby claim:

  • I am atomkirk on github.
  • I am atomkirk (https://keybase.io/atomkirk) on keybase.
  • I have a public key whose fingerprint is 1C0B BAC4 856C 3A57 29B0 6A25 659B F134 DCD3 F86E

To claim this, I am signing this object:

@atomkirk
atomkirk / gist:6d1a38a1636f7faa70de
Last active August 29, 2015 14:03
The Ecstasy and Disappointment of App Store Rankings

In 2010, Rob Foster and I released our first app, Calvetica, to the app store. It was one of the first two or three, if not the first, third-party calendar apps to use the new Event Kit that was released with iOS 4. The first day we sold around 20 copies, which wasn't bad I guess, but we're pie-in-the-sky dreamers, so we were a little disappointed. The next day, I woke to see we had sold 700 copies, and it got better and stayed that way for a while. It was the most excitement I'd felt since Christmas as a kid, watching our app climb the app store rankings. We made a lot of money.

Then, to our confusion and great disappointment, the rankings started to slip. Then, John Gruber linked to it on Daring Fireball and we sold about 2000 a day for a while and go to the #2 spot in productively and the #50 spot in the whole App Store. Thank you John! But, that was also just a spike. We began to watch our app sink again and wondered if and when it would stop. I bet if any app developers are reading this, they are shakin