Skip to content

Instantly share code, notes, and snippets.

View marothstein's full-sized avatar

Matt Rothstein marothstein

View GitHub Profile
@marothstein
marothstein / AppDelegate.m
Last active August 29, 2015 14:01
login view controller situation - do I need a custom delegate?
// 1. App starts
// 2. If user is not logged in, rootViewController presents loginViewController (Code below)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
...
// Now check for authentication
[self checkIfLoggedIn];
...
return YES;
}
@marothstein
marothstein / import_page.css
Created July 26, 2014 16:45
Import page CSS edits
.page-content {
overflow-x: hidden !important;
min-width: 920px;
}
@marothstein
marothstein / import_page.css
Created July 26, 2014 16:45
Import page CSS edits
.page-content {
overflow-x: hidden !important;
min-width: 920px;
}
@marothstein
marothstein / test.txt
Created July 1, 2015 22:17
a test gist
this is a test
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@marothstein
marothstein / Example.coffee
Created September 30, 2012 20:21
Example CoffeeScript gist to test highlighting
# Assignment:
number = 42
opposite = true
# Conditions:
number = -42 if opposite
# Functions:
square = (x) -> x * x
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@marothstein
marothstein / BoardingManager.js.coffee
Last active December 22, 2015 18:39
Boarding manager classes to work with the boarding APIs
Number::truncate = (decimal_places) ->
factor = Math.pow(10, decimal_places)
Number(Math.ceil(this * factor) / factor).toFixed decimal_places
String::sanitize = ->
@replace /[A-Za-z$-,]/g, ""
class Boarding.Helpers.BoardingManager extends Backbone.Events
token: null
permissions: null
@marothstein
marothstein / .git-completion.sh
Created October 7, 2013 17:24
Save to your home directory with the name '.git-completion.sh'
#!bash
#
# bash/zsh completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
@marothstein
marothstein / .git-prompt.sh
Created October 7, 2013 17:25
Save to your home directory with the name '.git-prompt.sh'
# bash/zsh git prompt support
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Distributed under the GNU General Public License, version 2.0.
#
# This script allows you to see the current branch in your prompt.
#
# To enable:
#
# 1) Copy this file to somewhere (e.g. ~/.git-prompt.sh).