Skip to content

Instantly share code, notes, and snippets.

@wesbos
wesbos / async-await.js
Created February 22, 2017 14:02
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@jayankandathil
jayankandathil / start.bat
Last active June 16, 2017 15:31
Adobe AEM 6.0 Windows start.bat for MongoDB (DEV environment)
@echo off
:: This script configures the start information for this server.
::
:: The following variables may be used to override the defaults.
:: For one-time overrides the variable can be set as part of the command-line; e.g.,
::
:: SET CQ_PORT=1234 & ./start.bat
::
setlocal
window.stoppingPropagation = (callback) -> (e) ->
e.stopPropagation()
callback(e)
angular.module('myApp',[]).directive 'ngTap', ->
(scope, element, attrs) ->
tapping = false
element.bind 'touchstart', stoppingPropagation (e) -> tapping = true
element.bind 'touchmove', stoppingPropagation (e) -> tapping = false
element.bind 'touchend', stoppingPropagation (e) -> scope.$apply(attrs['ngTap']) if tapping