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 / most-beautiful-js-ever.js
Last active Sep 13, 2016
A collection of weepingly beautiful javascript written by other people. For me to open late at night and admire secretly.
View most-beautiful-js-ever.js
// Pull a secret string out of ordered triplets
// @LesRamer
var recoverSecret = function(triplets) {
for(var [first] of triplets)
if (triplets.every(tuple => tuple.indexOf(first) <= 0))

No Runtime Error:

func == (l: Car, r: Car) -> Bool { return == }
struct Car { let vin: String }
protocol hasDriversLicense: class {
  var car: Car? { get set }
class YoungPro: hasDriversLicense {
SimplGy / hamming.go
Created Sep 4, 2016
A beautiful piece of code I didn't write
View hamming.go
// cosmin said
// October 30, 2012 at 7:14 PM
// Another solution based upon Dijkstra’s paper:
def hammingSeq(N):
h = [1]
i2, i3, i5 = 0, 0, 0
for i in xrange(1, N):
x = min(2*h[i2], 3*h[i3], 5*h[i5])
# Update the system's packages
apt-get update
apt-get upgrade
# Set up the `deploy` user
useradd deploy
mkdir /home/deploy
mkdir /home/deploy/.ssh
chmod 700 /home/deploy/.ssh
usermod -s /bin/bash deploy
View Offline Album Art - Spotify Feature

If you use Spotify without cellular data, all you'll ever see for album art is a gray circle with a white musical note inside it.


I'm pretty familiar with spotify. Been a paid subscriber for a long time and visited Sweden, staying in the Jarl Birger hotel right under you guys. :)

Still, I never noticed how much I missed album art until one day I accidentally left cellular data on and chewed through a half gig of data.

I love album art. It's beautiful, connects me to the band, and I always want to see it.

SimplGy / Wrap+Unbox+Symmetrical.swift
Last active May 17, 2016
An Experiment working on Enforced Symmetricality with JohnSundell's Wrap+Unbox
View Wrap+Unbox+Symmetrical.swift
// A definition for the kind of model objects this library can work on
import Foundation
public protocol CollieModel: Unboxable, WrapCustomizable, Hashable, CustomStringConvertible {
/// Configure the mapping between client and server property names. keys are client names and values are JSON names eg: "authorId: "author_id"
static var propertyMapping: [String: String]? { get }
SimplGy / optionalEnum.swift
Last active Jul 19, 2016
Switching on optional enums
View optionalEnum.swift
enum Coin {
case heads
case tails
var result: Coin?
// You can pattern match against it like an optional:
switch result {
case .heads?: print("heads")
case .tails?: print("tails")
SimplGy / openDeepLink.swift
Last active Mar 24, 2016
Opens a deep link into an app (Waitress). If that app isn't installed, open the app store for the app instead. Encode a back link into the app open url so the target app can navigate back to this app.
View openDeepLink.swift
SimplGy /
Last active Mar 17, 2016
Jekyll Cheat Sheet

Jekyll Cheat Sheet

Preview posts

Add a _drafts folder as a sibling of _posts. You add posts inside it the same way. To preview drafts, start jekyll with jekyll s --wD. The D is for Drafts.

Categorize blog posts

Jekyll only allows one category per post. You can apply the category by front matter or subfolder, but subfolder never gets forgotten so it's recommended. If you need more than one "something" per post, create a separate front matter field:

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))")
You can’t perform that action at this time.