Skip to content

Instantly share code, notes, and snippets.

function resetTime(date) {
date.setHours(0, 0, 0, 0);
return date;
}
function isMinimumAge(date, minimumAge) {
const inputDate = resetTime(new Date(date.getTime()))
const minimumDate = resetTime(new Date());
minimumDate.setFullYear(minimumDate.getFullYear() - minimumAge);
@lamchau
lamchau / controllers.application.js
Last active September 27, 2016 02:59
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
currentYear: 2016,
game: {
title: `Tom Clancy's Rainbow Six: Siege`,
},
user: {
name: 'Lam'
},
@lamchau
lamchau / controllers.application.js
Last active September 27, 2016 03:00
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
currentYear: 2016,
game: {
title: `Tom Clancy's Rainbow Six: Siege`,
},
video: {
channelName: 'lolRenaynay',
thumbnails: [
import Component from 'ember-component';
import { assert } from 'ember-metal/utils';
const DEFAULT_CLASS_NAME = 'simple-checkbox';
const AVAILABLE_POSITIONS = ['top', 'middle'];
export default Component.extend({
classNames: `${DEFAULT_CLASS_NAME}`,
classNameBindings: [`disabled:${DEFAULT_CLASS_NAME}--disabled`],
// remove modal
$(".tp-modal").remove();
$(".tp-backdrop").remove();
// allow scrolling
$("body").removeClass("tp-modal-open");
import Ember from "ember";
export default Ember.Component.extend({
classNames: ["etch-field", "float-label__container"],
tagName: "label",
content: null,
inputClassName: null,
options: {
minimumResultsForSearch: -Infinity
import Ember from "ember";
import {
module,
test,
} from "qunit";
module("async-safe-patch");
function testSetter(type) {
test(`${type}: set`, assert => {
var input = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
];
var output = [
[1],
[4, 2],
[7, 5, 3],
#!/usr/bin/env bash
script_name="${0##*/}"
if [ "$#" -ne 2 ]; then
echo "Usage: $script_name width height refresh"
exit 1
fi
width=$1
height=$2