I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
| var Shopify = Shopify || {}; | |
| // --------------------------------------------------------------------------- | |
| // Money format handler | |
| // --------------------------------------------------------------------------- | |
| Shopify.money_format = "${{amount}}"; | |
| Shopify.formatMoney = function(cents, format) { | |
| if (typeof cents == 'string') { cents = cents.replace('.',''); } | |
| var value = ''; | |
| var placeholderRegex = /\{\{\s*(\w+)\s*\}\}/; | |
| var formatString = (format || this.money_format); |
| const path = require('path'); | |
| const webpack = require('webpack'); | |
| const NameAllModulesPlugin = require('name-all-modules-plugin'); | |
| module.exports = { | |
| entry: { | |
| main: './src/foo', | |
| other: './src/foo-two', | |
| vendor: ['preact'] | |
| }, |
| import { h, Component } from 'preact'; | |
| import { Router } from 'preact-router'; | |
| import Header from './header'; | |
| import Home from '../routes/home'; | |
| import Profile from '../routes/profile'; | |
| import NotifyChange from "./NotifyChange/index"; | |
| // import Home from 'async!../routes/home'; | |
| // import Profile from 'async!../routes/profile'; |
| if (typeof window!=='undefined' && navigator.serviceWorker && navigator.serviceWorker.controller) { | |
| let reloadOnNext = false; | |
| let pushState = history.pushState; | |
| history.pushState = function(state, title, url) { | |
| pushState.call(this, state, title, url); | |
| if (reloadOnNext===true) location.reload(true); | |
| }; | |
| navigator.serviceWorker.controller.addEventListener('statechange', e => { |
| On iTerm2 - Open Preferences > Profiles > Keys > Key Mappings > Presets > Select Natural Text Editing | |
| - You can move a word backwards using Option ⌥ + ← and a word forwards using Option ⌥ + → | |
| - Move to the start of the line using fn + ← and to the end of the line with fn + →. | |
| - Also you can delete a word backwards using Option ⌥ + ⌫, delete the whole line using Command ⌘ + ⌫. | |
| If the preset doesn't appear, reinstall iTerm2. If you installed it using Homebrew + Cask: | |
| brew cask reinstall iterm2 |