Skip to content

Instantly share code, notes, and snippets.

Eric Miller SimplGy

Block or report user

Report or block SimplGy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
SimplGy / logVCinitAndDeinit.swift
Created Feb 12, 2016
Sometimes you need to make sure init and deinit happen in the right order on your View Controllers, and you don't stand up two at once.
View logVCinitAndDeinit.swift
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
print("init nibName: \(self) \(unsafeAddressOf(self))")
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
print("init coder: \(self) \(unsafeAddressOf(self))")
deinit {
print("deinit coder: \(self) \(unsafeAddressOf(self))")
SimplGy /
Last active Jan 4, 2016
Abstraction for an SPA's Analytics Library
() ->
_analyticsSites =
_libUrl = (server) ->
'js!' + server + '/js/piwik.js'
SimplGy / rotationalCipher.rb
Created Oct 10, 2013
Ruby Implementation of a Rotational Cipher. Wrote in
View rotationalCipher.rb
$alphabet = 'abcdefghijklmnopqurstvwxyz'
# Get an index of an alphabetic letter based on the index and offset
def calculateOffset(index, offset)
index += offset
index -= 26 while index >= 26 # keep subtracting until we get to the right range
SimplGy / promise.js
Last active Dec 25, 2015
Sample Promise Implementation. Wrote in
View promise.js
// --------------------------------------------- Promise Implementation
Promise = function () {
this._stack = [];
this._isResolved = false;
Promise.prototype = {
success: function(callback){
// Is the promise already resolved?
if(this._isResolved) {
callback( this._result );
SimplGy / algorithm test
Created Aug 30, 2013
Favorite unit test yet :) Uses a loop over a hash to test expectations
View algorithm test
define [
) ->
_data = [
{ size: 2 }
{ size: 2 }
SimplGy / 2xBackground
Created Aug 12, 2013
Creates 1x and 2x background images. The 200% means that the pixel offsets will work on both the small and large images. Make sure your sprites line up exactly, so that the 2x images are exactly twice as big, twice as low, and twice as left.
View 2xBackground
//Support 1 and 2x image sizes
@mixin 2xBackground($url)
background-image: url($url + ".png")
@media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min-device-pixel-ratio: 1.3)
background-image: url($url + "@2x.png")
background-size: 200%
SimplGy / screenSizeHelpers.sass
Last active Dec 20, 2015
Allows you to use simple block statements to conditionally target +phone, +desktop, and +tablet
View screenSizeHelpers.sass
$sizePhone: 603px
$sizeTablet: 1024px
@mixin phone
@media (max-width: $sizePhone)
@mixin tablet
@media (min-width: $sizePhone+1) and (max-width: $sizeTablet)
SimplGy / apple-app-site-association
Last active Dec 20, 2015
Waitress app site assoc file
View apple-app-site-association
"applinks": {
"apps": [],
"details": [
"appID": "",
"paths": [ "/place/*" ]
SimplGy / animationPlay
Last active Dec 18, 2015
SASS Animation Play
View animationPlay
$colorGood: lawngreen
background: $colorGood
+animation( blammo .5s )
SimplGy / rockerButton.sass
Last active Dec 17, 2015
SASS styles for an image free rocker switch button for yes/no or similar 2 option choices. It's tricky in part because it's the `.active` state that has little styling, but the inactive state has transforms and other wonkiness. Output looks like this:
View rockerButton.sass
// Result:
@import '../bower_components/bourbon/app/assets/stylesheets/_bourbon.scss'
$colorBackbground: whitesmoke
$colorForeground: #333
$colorGood: springgreen
$radiusSmall: 4px
$spaceTiny: 3px
$spaceLil: 10px
You can’t perform that action at this time.