This file contains hidden or 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
| (function (_window) { | |
| var Slider = function ($wrapper) { | |
| var self = this; | |
| self.$wrapper = $wrapper; | |
| self.$lis = $wrapper.find("li"); | |
| self.slideSize = self.$lis.first().width(); | |
| self.currentIndex = 0; | |
| self.maximumIndex = self.$lis.length - 1; |
This file contains hidden or 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
| /** | |
| * input: ["leary", "abc", "early", "relay", "rayle", "layer", "cba"] | |
| * output: [["leary", "early", "relay", "rayle", "layer"], ["abc", "cba"]] | |
| */ | |
| const inputs = ["leary", "abc", "early", "relay", "rayle", "layer", "cba"]; | |
| const haystack = {}; | |
| inputs.forEach(input=>{ | |
| const sortedInput = input.split("").sort().join(""); |
This file contains hidden or 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
| import random | |
| def sort(ar): | |
| if len(ar) < 2: | |
| return ar | |
| hand = ar.pop(random.randrange(len(ar))) | |
| return sort([a for a in ar if a < hand]) + [hand] + sort([a for a in ar if a >= hand]) | |
This file contains hidden or 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
| (function(){ | |
| var $ = function(sel, ne) { | |
| var e = null; | |
| var _ = this; | |
| _.init = function(_sel, ne){ | |
| if(typeof ne != 'undefined'){ | |
| _.e = ne; | |
| }else if(typeof _sel == 'string'){ | |
| _.e = document.querySelectorAll(_sel); | |
| }else if(_.isDom(_sel)){ |