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
| export default Ember.Component.extend({ | |
| fadeDurationInMilliseconds: 300, | |
| didInsertElement() { | |
| let duration = this.get("fadeDurationInMilliseconds"), | |
| element = this.$(); | |
| element.fadeIn(duration); | |
| }, | |
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
| if (window.location.host === "instagram.com" && window.location.pathname.startsWith("/p/")) { | |
| var images = document.querySelectorAll(".-cx-PRIVATE-Photo__image"); | |
| var length = images.length; | |
| if (length) { | |
| var element = images[length - 1]; | |
| if (element.src) { | |
| window.location.href = element.src; | |
| } | |
| } | |
| } |
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
| package com.lchau; | |
| import java.util.Arrays; | |
| import java.util.Collections; | |
| import java.util.List; | |
| import java.util.concurrent.TimeUnit; | |
| public class Program { | |
| public static void main(String[] args) { |
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
| /* | |
| * This file is a ported version of | |
| * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/test/jtreg/util/concurrent/TimeUnit/Basic.java?view=co | |
| * which contained the following header: | |
| */ | |
| /* | |
| * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. | |
| * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| * |
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(Factory, Lorem, underscore) { | |
| var SHA_CHARS = "0123456789abcdef"; | |
| var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
| var CATEGORIES = ["Low", "Medium", "High"]; | |
| var ONE_YEAR_IN_MILLISECONDS = 31536000000; | |
| var _ = underscore; | |
| var methods; | |
| // http://www.ssa.gov/oact/babynames/decades/century.html | |
| var FIRST_NAME = ["James", "John", "Robert", "Michael", "William", "David", "Richard", "Joseph", "Charles", "Thomas", "Christopher", "Daniel", "Matthew", "Donald", "Anthony", "Mark", "Paul", "Steven", "George", "Kenneth", "Mary", "Patricia", "Jennifer", "Elizabeth", "Linda", "Barbara", "Susan", "Margaret", "Jessica", "Sarah", "Dorothy", "Karen", "Nancy", "Betty", "Lisa", "Sandra", "Ashley", "Kimberly", "Donna", "Helen"]; | |
| // https://en.wikipedia.org/wiki/List_of_most_common_surnames_in_North_America |
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 findBalancePoint(array) { | |
| if (array.length === 0) { | |
| return 0; | |
| } | |
| if (array.length === 1) { | |
| return 1; | |
| } | |
| // initial sums | |
| var left = 0; | |
| var right = 0; |
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 getPath(object, path) { | |
| if (typeof object === 'undefined' || typeof path !== 'string') { | |
| return undefined; | |
| } | |
| var index = path.trim().indexOf('.'); | |
| if (index < 0) { | |
| return object[path]; | |
| } |
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 Stats(data, precision) { | |
| var PRECISION = precision || 2; | |
| var length = data.length; | |
| var mean = (function() { | |
| var sum = data.reduce(function(a, b) { | |
| return a + b; | |
| }, 0); | |
| return sum / length; | |
| })(); |
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
| // a1Foo => a1_foo | |
| function getRange(start, end) { | |
| return [start.charCodeAt(0), end.charCodeAt(0)]; | |
| } | |
| function inRange(value, start, end) { | |
| return value >= start && value <= end; | |
| } |
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
| var checkOption = function(optionName) { | |
| return process.argv.some(function(option) { | |
| if (option.indexOf("--", 0) === 0 && optionName) { | |
| return option.substr(2).toLowerCase() === optionName.toLowerCase(); | |
| } | |
| return false; | |
| }); | |
| }; |