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
# helpers | |
# $ = jQuery | |
# See: http://learn.jquery.com/code-organization/deferreds/examples/ | |
# Generic asynchronous cache | |
$.createCache = (requestFunction)-> | |
cache = {}; | |
return (key, callback)-> | |
if ( !cache[key] ) | |
cache[key] = $.Deferred((defer)-> |
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
class Animator | |
constructor: (obj)-> | |
@obj = obj | |
@stack = [] | |
console.log this | |
add: (property, to, duration, callback, easing)-> | |
@stack.push { | |
property: property |
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
<link rel="apple-touch-icon-precomposed" sizes="57x57" | |
href="{{ app_asset('img/fav/apple-touch-icon-57x57.png') }}"/> | |
<link rel="apple-touch-icon-precomposed" sizes="114x114" | |
href="{{ app_asset('img/fav/apple-touch-icon-114x114.png') }}"/> | |
<link rel="apple-touch-icon-precomposed" sizes="72x72" | |
href="{{ app_asset('img/fav/apple-touch-icon-72x72.png') }}"/> | |
<link rel="apple-touch-icon-precomposed" sizes="144x144" | |
href="{{ app_asset('img/fav/apple-touch-icon-144x144.png') }}"/> | |
<link rel="apple-touch-icon-precomposed" sizes="60x60" | |
href="{{ app_asset('img/fav/apple-touch-icon-60x60.png') }}"/> |
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
// app/helpers/iftrue.js | |
import Ember from 'ember'; | |
export function iftrue(params) { | |
if (params[0]) { | |
return params.length === 2 ? params[0] : params[1]; | |
} | |
if (params.length === 2) { | |
return params[1]; | |
} else if (params.length === 3) { |
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
<?php | |
namespace App\Support; | |
/** | |
* Get files from raw multipart input generated by frontend ajax uploaders | |
* | |
* Class JsonUploader | |
* @package App\Support |
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
echo "www-data ALL=(ALL:ALL) NOPASSWD:/usr/bin/docker inspect *" >> /etc/sudoers |
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
const gulp = require('gulp'); | |
const watch = require('gulp-watch'); | |
const browserify = require('browserify'); | |
const babelify = require('babelify'); | |
const transform = require('vinyl-transform'); | |
const minify = require('gulp-minify'); | |
const ifElse = require('gulp-if-else'); | |
const argv = require('yargs').argv; |
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 class Spoiler { | |
constructor(container) { | |
this.container = container; | |
this.opener = this.container.querySelector('.opener'); | |
this.content = this.container.querySelector('.content'); | |
this.isAnimating = false; | |
this.opened = false; | |
this.container.addEventListener(transitionend, ()=>{ | |
this.isAnimating = false; |
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
sudo rm -f /opt/vagrant-vmware-desktop/settings/nat.json | |
sudo killall vagrant-vmware-utility |
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
Length of random ints array: 1000000 | |
Run looper | |
res: 99999883 | |
Time elapsed: 7 | |
Run reducer | |
res: 99999883 | |
Time elapsed: 26 | |
Diff: 19 |