This file contains 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
1) Stores | |
- Stores can be specific to a domain (ProductStore, ShoppingCartStore) | |
- Stores can be specific to a view (esp pages, like PopularProductPageStore) | |
- Emit events, in 99% of the time only 'change' events, in special very rare case we need to use other event types. | |
- Contains a single immutable map/single object as its data | |
- Should only be concerned on storage kind of logic (meaning no API calls here) | |
2) Views (Components) | |
- Contains no application state | |
- Should only contain transient states (states that can be lost, like if you the tab's position or don't need to programatically change the tab position, then view can store the tab position instead of having it in the stores) |
This file contains 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
/* | |
Commands: | |
/muteall | |
/unmuteall | |
/muteme | |
/unmuteme | |
/mute |
This file contains 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
/* Exports */ | |
module.exports = function(opts){ | |
var processFunction = opts.processFunction; // Returns a promise | |
var delay = opts.delay || 100; | |
var concurrency = opts.concurrency || 10; | |
var deleteIfFail = opts.deleteIfFail || false; | |
var queue = []; | |
var processing = false; |
This file contains 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
var VolumeMeter = function(audioOrStream, shouldStillPlayAudio){ | |
var _this = this; | |
var streamData = new Uint8Array(128); | |
window.VolumeMeterAudioContext = window.VolumeMeterAudioContext || new (window.AudioContext || window.webkitAudioContext); | |
this._audioCtx = window.VolumeMeterAudioContext; | |
this._analyser = this._audioCtx.createAnalyser(); | |
this._analyser.fftSize = 256; | |
this._analyser.smoothingTimeConstant = 0.2; |
This file contains 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
cd /usr/local/share/ | |
sudo wget http://nodejs.org/dist/v0.10.26/node-v0.10.26-linux-x64.tar.gz | |
sudo tar xvf node-v0.10.26-linux-x64.tar.gz | |
sudo rm -rf node-v0.10.26-linux-x64.tar.gz | |
sudo ln -s /usr/local/share/node-v0.10.26-linux-x64/bin/node /usr/local/share/node |
This file contains 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
<script src="https://apis.google.com/js/client.js?onload=gapiLoad"></script> | |
<script> | |
function gapiLoad() { | |
gapi.client.setApiKey('YOUR_API_KEY'); // app api-wide client api key | |
getGoogleContactEmails(function(result){ | |
console.log(result); | |
}); | |
} |
This file contains 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
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.GestureDetector; | |
import android.view.MotionEvent; | |
import android.view.View; | |
import android.widget.SeekBar; | |
/** | |
* Created by khankuan on 20/7/13. | |
* This custom SeekBar changes the progress based on tap gesture and scroll gesture separately. |