A Pen by David DeSandro on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var CustomersController = function (dependencies) { | |
var self = this; | |
var customerRepository = dependencies.customerRepository; | |
var errorHandler = dependencies.errorHandler; | |
var customersView = dependencies.customersView; | |
var init = function() { | |
//Set up handler for 'loadCustomer' event | |
$(dependencies.document).on('loadCustomer', function (evt, id) { | |
self.loadCustomerById(id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple bijective function | |
# Basically encodes any integer into a base(n) string, | |
# where n is ALPHABET.length. | |
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047 | |
ALPHABET = | |
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//) | |
# make your own alphabet using: | |
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join |
I hereby claim:
- I am actualal on github.
- I am alxrdmn (https://keybase.io/alxrdmn) on keybase.
- I have a public key ASCbHm8XDAE5pn0F5dop8glzCYMKLzJKJCmz2921HBIg5wo
To claim this, I am signing this object: