Skip to content

Instantly share code, notes, and snippets.

View marothstein's full-sized avatar

Matt Rothstein marothstein

View GitHub Profile
@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 / 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 / GetCardSwipe.js
Last active September 30, 2022 18:00
Basic implementation of methods needed to receive swiped credit card data with javascript.
/*
* Basic implementation of methods needed to receive swiped credit card data with javascript.
*
* NOTE: PCI compliance specifies that card data must never be stored in an unencrypted manner, and
* only certain pieces of card data can be stored persistently. Ensure that output logging is NOT
* stored persistently when using this file, as it contains console.log messages that are intended
* to educate the user, and these messages contain data that may compromise your PCI compliance posture.
*
* If you choose to use any of this code with real credit card data, it is your responsibility
* to remove all log statements, output, or other code that may serve to persist offending information.
<!-- 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 / 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