Skip to content

Instantly share code, notes, and snippets.


Jamie Kosoy jkosoy

View GitHub Profile
jkosoy / TheBigShow.json
Created Apr 15, 2016
Melody Jams JSON example
View TheBigShow.json
"code": 200,
"data": {
"jam": {
"status": "ready",
"jam_id": "TheBigShow",
"created": "2016-03-16T00:00:00-07:00",
"last_updated": "2016-03-16T00:00:00-07:00",
"name": "The Big Show",
"ios": {
jkosoy / CoreGraphics+AspectRatio.swift
Created Apr 14, 2016
Calculating for different device Aspect Ratios, used in Melody Jams
View CoreGraphics+AspectRatio.swift
// CoreGraphics+AspectRatio.swift
// EmptySpriteKitGame
// Created by Jamie Kosoy on 11/6/15.
// Copyright © 2015 Arbitrary. All rights reserved.
import UIKit
import Foundation
jkosoy / pseudo.js
Created Mar 9, 2016
Promises Explained
View pseudo.js
animateFareTextIn(function() {
animateWeatherTextIn(function() {
animateDividerIn(function() {
animateLoadingSentence1In(function() {
animateLoadingSenetence2In(function() {
// all done!
View IntroView.swift
// IntroView.swift
// Fare Weather
// Created by Jamie Kosoy on 3/8/16.
// Copyright © 2016 Arbitrary. All rights reserved.
import UIKit
import CFAAction
jkosoy / MainViewController.swift
Last active Mar 8, 2016
Fare Weather Prototype 010
View MainViewController.swift
// ViewController.swift
// Fare Weather
// Created by Jamie Kosoy on 2/23/16.
// Copyright © 2016 Arbitrary. All rights reserved.
import UIKit
import PromiseKit
jkosoy / example.swift
Last active Feb 29, 2016
CFAAction+AHEasing example
View example.swift
let foo = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) =
foo.layer.backgroundColor = UIColor.blueColor().CGColor
foo.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5)
foo.layer.opacity = 1.0
let fade = CFAAction.fade(fromValue: 0, toValue: 1, time: 2.5, curveType: CurveType.CurveTypeQuintic, easeType: EaseType.EaseTypeOut)
let scale = CFAAction.scale(fromValue: 1.0, toValue: 2.5, time: 1, curveType: CurveType.CurveTypeBounce, easeType: EaseType.EaseTypeOut)
let rotate = CFAAction.rotate(fromValue: 0.0, toValue: CGFloat( M_PI ), time: 1, curveType: CurveType.CurveTypeBounce, easeType: EaseType.EaseTypeOut)
jkosoy / CGSize+AspectFunctions.swift
Last active Nov 16, 2020
Aspect Fill and Aspect Fit calculations in Swift
View CGSize+AspectFunctions.swift
// port of
import UIKit
import Foundation
extension CGSize {
static func aspectFit(aspectRatio : CGSize, var boundingSize: CGSize) -> CGSize {
let mW = boundingSize.width / aspectRatio.width;
let mH = boundingSize.height / aspectRatio.height;
View ready.js
var ready=function(){function i(){if(r.isReady){return}try{document.documentElement.doScroll("left")}catch(e){setTimeout(i,1);return}r.ready()}function s(t){r.bindReady();var n=r.type(t);e.done(t)}var e,t,n={};n["[object Boolean]"]="boolean";n["[object Number]"]="number";n["[object String]"]="string";n["[object Function]"]="function";n["[object Array]"]="array";n["[object Date]"]="date";n["[object RegExp]"]="regexp";n["[object Object]"]="object";var r={isReady:false,readyWait:1,holdReady:function(e){if(e){r.readyWait++}else{r.ready(true)}},ready:function(t){if(t===true&&!--r.readyWait||t!==true&&!r.isReady){if(!document.body){return setTimeout(r.ready,1)}r.isReady=true;if(t!==true&&--r.readyWait>0){return}e.resolveWith(document,[r])}},bindReady:function(){if(e){return}e=r._Deferred();if(document.readyState==="complete"){return setTimeout(r.ready,1)}if(document.addEventListener){document.addEventListener("DOMContentLoaded",t,false);window.addEventListener("load",r.ready,false)}else if(document.attachEvent){doc
View Git

Git Flow

I keep meeting people who struggle to wrap their heads around the proper way to use Git + Github. This snippet is designed to explain Vincent Driessen's git branching model, at least as well as I understand it. Speacial thanks to Stephen Koch for being the true master here.

This tutorial is for Linux or OSX. Feel free to use Cygwin or write a fork for windows.

A way to think about Git and Github.

jkosoy / gist:5379904
Last active Nov 9, 2020
Raspberry Pi setup
View gist:5379904

Raspberry Pi setup

Just wanted a quick start guide for myself so that I wouldn't have to keep rooting through Google to remember all this stuff. Hopefully it helps other people.

If you had other ideas or suggestions please leave a comment.

Useful things to own before you buy a Pi

The first time I bought a Pi I was enormously frustrated with myself because I didn't own all of this stuff. Kept having to order things off of Amazon and wait to get started... very irritating. This is all good stuff to have laying around anyway:

You can’t perform that action at this time.