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
angular.module('app') | |
.filter('isoCurrency', function($filter) { | |
var currencies = { | |
"ALL":{"text":"Lek"}, | |
"AFN":{"text":"؋"}, | |
"ARS":{"text":"$"}, | |
"AWG":{"text":"ƒ"}, | |
"AUD":{"text":"$"}, | |
"AZN":{"text":"ман"}, |
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
// get all items of all players | |
/* WITHOUT ES6 spread operator */ | |
const items = []; | |
players.forEach((player) => { | |
player.forEach((item) => { | |
items.push(item); | |
}); | |
}); | |
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
/** | |
* e.g. retrieving field values from a form. | |
*/ | |
function getDateFromForm() { | |
const props = ['year', 'month', 'day', 'hour', 'minutes', 'sec', 'milisec']; | |
return props.map((prop) => { | |
return document.querySelector(`#${prop}`).text; | |
}); | |
} |
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
- QuicksandBook | |
- QuicksandLight | |
- BLOKK | |
- Lobster | |
- DroidSerif | |
- PT Sans | |
- Freight Sans Pro | |
- Lane | |
- Source Sans Pro | |
- Robotolight |
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
let objectType: String = 'first string'; | |
let primitiveType: string = 'second string'; | |
objectType = primitiveType; // √ | |
primitiveType = objectType; // compiler error |
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
// less error prone DOM manipulation | |
[].filter.call([document.querySelector('.single-selected-class')], item => item) | |
.forEach(item => item.blur()); |
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
-- === sizeup === | |
-- | |
-- SizeUp emulation for hammerspoon | |
-- | |
-- To use, you can tweak the key bindings and the margins | |
local sizeup = { } | |
-------------- | |
-- Bindings -- |
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
# ISSUE: | |
# Stuck authenticating with Itunes Store | |
# | |
# ERROR: | |
# Archive upload failed due to the issues listed below. | |
# This action could not be completed. Try again (-22421) | |
cd ~ | |
mv .itmstransporter/ .old_itmstransporter/ | |
"/Applications/Xcode.app/Contents/Applications/Application Loader.app/Contents/itms/bin/iTMSTransporter" |
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
// make the whole serviceworker process into a promise so later on we can | |
// listen to it and in case new content is available a toast will be shown | |
window.isUpdateAvailable = new Promise(function(resolve, reject) { | |
// lazy way of disabling service workers while developing | |
if ('serviceWorker' in navigator && ['localhost', '127'].indexOf(location.hostname) === -1) { | |
// register service worker file | |
navigator.serviceWorker.register('service-worker.js') | |
.then(reg => { | |
reg.onupdatefound = () => { | |
const installingWorker = reg.installing; |
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
// listen to the service worker promise in index.html to see if there has been a new update. | |
// condition: the service-worker.js needs to have some kind of change - e.g. increment CACHE_VERSION. | |
window['isUpdateAvailable'] | |
.then(isAvailable => { | |
if (isAvailable) { | |
const toast = this.toastCtrl.create({ | |
message: 'New Update available! Reload the webapp to see the latest juicy changes.', | |
position: 'bottom', | |
showCloseButton: true, | |
}); |