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
| // # Mocha Guide to Testing | |
| // Objective is to explain describe(), it(), and before()/etc hooks | |
| // 1. `describe()` is merely for grouping, which you can nest as deep | |
| // 2. `it()` is a test case | |
| // 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run | |
| // before/after first/each it() or describe(). | |
| // | |
| // Which means, `before()` is run before first it()/describe() |
| diff -rupN mage_org/app/code/core/Mage/Catalog/Model/Url.php src_shop/app/code/core/Mage/Catalog/Model/Url.php | |
| --- mage_org/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:48:25.679009391 +0100 | |
| +++ src_shop/app/code/core/Mage/Catalog/Model/Url.php 2013-11-19 00:49:24.188005601 +0100 | |
| @@ -643,13 +643,24 @@ class Mage_Catalog_Model_Url | |
| $this->_rewrite = $rewrite; | |
| return $requestPath; | |
| } | |
| + | |
| + // avoid unnecessary creation of new url_keys for duplicate url keys | |
| + $noSuffixPath = substr($requestPath, 0, -(strlen($suffix))); |
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
o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
O.......Recursively open the selected directory..................|NERDTree-O|
People
:bowtie: |
😄 :smile: |
😆 :laughing: |
|---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
| sudo su | |
| yum update -y | |
| #*************** INSTALL JAVA JDK 8*********************# | |
| yum install java-1.8.0-openjdk -y | |
| #*************** INSTALL ELASTICSEARCH 1.5.2 + RECOMMENDED PLUGINS *********************# | |
| wget https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.5.2.noarch.rpm | |
| yum install elasticsearch-1.5.2.noarch.rpm -y | |
| rm -f elasticsearch-1.5.2.noarch.rpm |
| if ! type "brew" > /dev/null; then | |
| ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"; | |
| fi | |
| brew tap phinze/homebrew-cask && brew install brew-cask; | |
| brew cask install vagrant; | |
| brew cask install virtualbox; |
Most configuration really isn't about the app -- it's about where the app runs, what keys it needs to communicate with third party API's, the db password and username, etc... They're just deployment details -- and there are lots of tools to help manage environment variables -- not the least handy being a simple .env file with all your settings. Simply source the appropriate env before you launch the app in the given env (you could make it part of a launch script, for instance).
env files look like this:
SOMEVAR="somevalue"
ANOTHERVAR="anothervalue"
To source it:
$ source dev.env # or staging.env, or production.env, depending on where you're deploying to
| var coinTypes = [25, 10, 5]; | |
| var coinNb = [8, 12, 20]; | |
| function computeChange(change,coinTypes, coinNb) { | |
| var rez = []; | |
| for (var i = 0; i < coinTypes.length; ++i) { | |
| if (coinTypes[i] === 0) continue; | |
| var coinsToGet = Math.floor(change / coinTypes[i]); | |
| if (coinsToGet > coinNb[i]) { | |
| coinsToGet = coinNb[i]; | |
| } |