- bootstrap with typeahead
- jquery
This will use bootstrap with typeahead to create an autocomplete search.
| <pre> | |
| <?php | |
| //By @pkspencer | |
| function generateNines_One($numNines) | |
| { | |
| $result = 0; | |
| for ($i=0; $i < $numNines; $i++) { | |
| $result += pow(10, $i); | |
| } |
| var AppObject = Ember.Object.extend({ | |
| /** | |
| * Get a list of all computed properties set on this instance | |
| * | |
| * @method getComputedPropertyList | |
| * @return {Array} List of computed properties (strings) | |
| * @since TODO | |
| */ | |
| getComputedPropertyList: function() { |
| local sendEscape = true | |
| local ctrlKeyTimer = hs.timer.delayed.new(0.15, function() | |
| sendEscape = false | |
| end) | |
| local lastMods = {} | |
| local flagsChangedHandler = function(event) | |
| local newMods = event:getFlags() | |
| if lastMods.ctrl == newMods.ctrl then return false end |
| // isCouponInCategories :: Array<Object> => Object -> Boolean | |
| const isCouponInCategories = categories => coupon => | |
| categories.includes(coupon.category); | |
| // percentDiscount :: Object -> Number | |
| const percentDiscount = coupon => | |
| ((coupon.couponAmount / coupon.itemPrice) * 100); | |
| // TODO: I decided to remove the code after the list was reduced | |
| // to the 10 coupons because of the "So in short" summary of |
| // --- UTILS ------------------------------------------------ | |
| // pipe :: ...Functions => a -> b | |
| const pipe = (...funcs) => data => | |
| funcs.reduce((acc, func) => func(acc), data); | |
| // toNumber :: String -> Number | |
| const toNumber = data => parseInt(data, 10); | |
| // double :: Number -> Number |
| // NOTE: Ramda repl | |
| console.clear() | |
| const foo = [ | |
| { id: 'one' }, | |
| { id: 'two' }, | |
| { id: 'three' }, | |
| ] |
| // NOTE: Ramda repl | |
| console.clear() | |
| const foo = (a, b) => a + b | |
| const bar = () => 4 | |
| const tryYolo = curry((func, params) => { | |
| try { | |
| return apply(func, params) |
| class ConsecutiveFailure { | |
| constructor({ | |
| count = 0, | |
| threshold = 10, | |
| logger = console.log, | |
| }) { | |
| this.count = count; | |
| this.threshold = threshold; | |
| this.logger = logger; | |
| } |
| console.clear() | |
| /////////////////////////////////////////////////////////////// | |
| // promise-utils.js | |
| // PromiseAll :: Promise.all | |
| const PromiseAll = (x) => Promise.all(x) | |
| // thenP :: Function -> Promise -> Promise | |
| const thenP = |