#Comprehensive Introduction to @ngrx/store By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
| // To mock globally in all your tests, add to setupTestFrameworkScriptFile in config: | |
| // https://facebook.github.io/jest/docs/en/configuration.html#setuptestframeworkscriptfile-string | |
| jest.mock('moment', () => { | |
| const moment = require.requireActual('moment-timezone'); | |
| moment.tz.setDefault('America/Los_Angeles'); // Whatever timezone you want | |
| return moment; | |
| }); |
| /** | |
| * Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
| * It was requested to be introduced at as part of the jsonwebtoken library, | |
| * since we feel it does not add too much value but it will add code to mantain | |
| * we won't include it. | |
| * | |
| * I create this gist just to help those who want to auto-refresh JWTs. | |
| */ | |
| const jwt = require('jsonwebtoken'); |
| #!/usr/bin/env bash | |
| sketchtool=/Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool | |
| #echo $(python --version) | |
| function extractSketchFile () { | |
| sketchFile=$1 | |
| folder=${sketchFile%.sketch} |
| func compressVideo(inputURL: NSURL, outputURL: NSURL, bitRate: Int, muteSound: Bool, onDone: () -> ()) { | |
| let videoAsset = AVURLAsset(URL: inputURL, options: nil) | |
| let videoTrack = videoAsset.tracksWithMediaType(AVMediaTypeVideo)[0] | |
| let videoSize = videoTrack.naturalSize | |
| let videoWriterCompressionSettings = [ | |
| AVVideoAverageBitRateKey: bitRate | |
| ] | |
| let videoWriterSettings:[String : AnyObject] = [ | |
| AVVideoCodecKey : AVVideoCodecH264, |
#Comprehensive Introduction to @ngrx/store By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
| import { mountWithIntl } from 'helpers/intl-enzyme-test-helper.js'; | |
| const wrapper = mountWithIntl( | |
| <CustomComponent /> | |
| ); | |
| expect(wrapper.state('foo')).to.equal('bar'); // OK | |
| expect(wrapper.text()).to.equal('Hello World!'); // OK |
| 'use strict' | |
| // const yargs = require('yargs') | |
| const express = require('express') | |
| const request = require('request') | |
| const uuid = require('node-uuid') | |
| const querystring = require('querystring') | |
| const opener = require('opener') | |
| let argv = require('yargs') |
| // This is not perfect | |
| private boolean isVirtualDeivce() { | |
| String msg = "BOARD = " + Build.BOARD + | |
| "\nBOOOTLOADER = " + Build.BOOTLOADER + | |
| "\nBRAND = " + Build.BRAND + | |
| "\nDEVICE = " + Build.DEVICE + | |
| "\nDISPLAY = " + Build.DISPLAY + | |
| "\nFINGERPRINT = " + Build.FINGERPRINT + | |
| "\nHARDWARE = " + Build.HARDWARE + | |
| "\nHOST = " + Build.HOST + |