Skip to content

Instantly share code, notes, and snippets.

View mitchellporter's full-sized avatar

Mitchell Porter mitchellporter

  • Seattle, WA
View GitHub Profile
@ericallam
ericallam / AppDelegate.m
Created May 22, 2014 14:49
Interactive Animated Transition Example
//
// AppDelegate.m
// AnimationExamplesiPhone
//
// Created by Eric Allam on 10/05/2014.
#import "AppDelegate.h"
#pragma mark - UIColor Additions
@stephenlb
stephenlb / Procfile
Last active April 17, 2019 21:40
Twitter / PubNub Bridge - Heroku Worker
tweetstream: node twitter-pubnub-stream.js
@stevenyap
stevenyap / Heroku_Staging.md
Last active June 11, 2019 16:09
Staging workflow on Heroku

This describes the workflow to use Heroku as a staging environment. It assumes you already have an existing heroku app in production.

# rename your git remote heroku to something else like production
git remote rename heroku production

# so now you will push as: git push production master

# create the staging app
heroku apps:create staging-appname
@warpling
warpling / Mento.playground
Last active August 1, 2019 20:11
Copying Tinder's "mentos" button animation (based on tweet: https://twitter.com/warpling/status/930567671015358464?s=20)
//: Playground - noun: a place where people can play
import UIKit
class Mento: UIView {
// The thickness ratio of our mento, 1.0 being a perfect sphere.
let mentoThicknessScale: CGFloat = 0.60
let shape: UIView = {
//: Mocks Playground
import UIKit
struct User {
}
struct PushNotificationController {
let registrar: PushNotificationRegistrar
init(registrar: PushNotificationRegistrar) {
@lg
lg / build_tvvlckit.sh
Last active April 5, 2020 15:48
Building MobileVLCKit for AppleTV: TVVLCKit
# note these instructions are as of Dec 28, 2015
# the vlc and vlckit repos are super complex and have thousands of dependencies from everywhere on the internet.
# so, you'll need to mess with things a bit
git clone http://code.videolan.org/videolan/VLCKit.git
cd VLCKit
./buildMobileVLCKit.sh -t
@JoeyBodnar
JoeyBodnar / gist:7be323b066058667851b
Created March 28, 2016 05:51
Video Loading/Caching with AVAssetResourceLoader
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
VideoCell *videoCell = (VideoCell *)[self.tableView dequeueReusableCellWithIdentifier:@"VideoCell"];
NSString *urlString = @"streaming://download.wavetlan.com/SVV/Media/HTTP/MOV/ConvertedFiles/MediaCoder/MediaCoder_test11_36s_H263_VBR_590kbps_176x144_25fps_MPEG1Layer3_CBR_160kbps_Stereo_22050Hz.mov";
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
// Configure Video Cell Here:
NSURL *url = [NSURL URLWithString:urlString];
videoCell.contentView.backgroundColor = [UIColor clearColor];
videoCell.backgroundColor = [UIColor clearColor];
@nleush
nleush / server-part.js
Created May 10, 2012 15:50
Node.JS + MongoDB: automatic anonymous user creation
// This function implements anonymous creation logic.
function loadOrCreateAnonymousProfile(req, res, next) {
var sess = req.session,
auth = sess && sess.auth;
if (!auth || !auth.userId) {
dbCounter('anonymousUsers', function(err, counter) {
if (err) {
console.log('Error getting anonymous users counter', err);
next();
@grvhi
grvhi / gist:fbda7c0afed03ae1ef8c
Created February 23, 2015 18:30
AWS Lambda Function to Trigger ElasticTranscoder Job on S3 Upload
console.log('Checking newly uploaded file');
var AWS = require('aws-sdk');
var s3 = new AWS.S3({apiVersion: '2006-03-01'});
var eltr = new AWS.ElasticTranscoder({
apiVersion: '2012-09-25',
region: 'us-east-1'
});
// ID of pipeline
var pipelineId = 'myID';
// ID of ET's web output preset
@andymatuschak
andymatuschak / CollectionViewDataSource.swift
Last active February 12, 2021 09:44
Type-safe value-oriented collection view data source
//
// CollectionViewDataSource.swift
// Khan Academy
//
// Created by Andy Matuschak on 10/14/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit