(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| // overriding sync to use local storage when possible | |
| sync : function(method, model, options){ | |
| var key, now, timestamp, refresh; | |
| if(method === 'read' && this.constants.isStoredInLocalStorage) { | |
| // only override sync if it is a fetch('read') request | |
| key = this.getKey(); | |
| if(key) { | |
| now = new Date().getTime(); | |
| timestamp = $storage.get(key + ":timestamp"); | |
| refresh = options.forceRefresh; |
| var safariDebug = ( navigator.platform.indexOf("iPhone") < 0 && navigator.platform.indexOf("iPod") < 0 && navigator.platform.indexOf("iPad") < 0 ); | |
| if(safariDebug) | |
| { | |
| PhoneGap.run_command = function() | |
| { | |
| if (!PhoneGap.available || !PhoneGap.queue.ready) | |
| return; |
| // Visual regression | |
| http://responsivenews.co.uk/post/56884056177/wraith | |
| https://www.npmjs.org/package/grunt-photobox | |
| http://cburgmer.github.io/csscritic/ | |
| https://github.com/Huddle/PhantomCSS | |
| http://siteeffect.io/ | |
| // CSS test | |
| http://csste.st/techniques/ |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| npm version prerelease --preid=next | |
| npm publish --tag=next |
| BRANCH_POINT="$(git merge-base $(git rev-parse --abbrev-ref HEAD) | |
| $(git describe origin/master))" | |
| changedPackages="$(npx lerna ls -p --since $BRANCH_POINT --include-dependents)" |
| import "regenerator-runtime/runtime"; | |
| import { combineReducers, applyMiddleware, createStore,compose } from 'redux'; | |
| import createSagaMiddleware from 'redux-saga'; | |
| import dynamicMiddlewares from 'redux-dynamic-middlewares'; | |
| import { composeWithDevTools } from 'redux-devtools-extension'; | |
| import { all } from 'redux-saga/effects'; | |
| const defaultConfig = { | |
| reducersToSkipFromClearing: [], |
| #!/bin/bash | |
| FILE_PATH=<env file path> | |
| echo $1 | |
| ESCAPED_REPLACE=$(printf '%s\n' "$2" | sed -e 's/[\/&]/\\&/g') | |
| echo $ESCAPED_REPLACE | |
| sed -i \ | |
| -r "s/^($1=).*/\1$ESCAPED_REPLACE/" $FILE_PATH | |
| grep -q -e "$1=$2" $FILE_PATH || echo $1=$2 >> $FILE_PATH |
| # size of directory | |
| du -sh <path> | |
| #tar gz directory | |
| tar -czvf target source |
| #!/bin/bash | |
| add-apt-repository ppa:ondrej/php | |
| apt-get update | |
| apt-get install php$1 | |
| apt-get install php$1-xdebug php$1-cli php$1-common php$1-json php$1-opcache php$1-mysql php$1-mbstring php$1-zip php$1-fpm php$1-intl php$1-simplexml php$1-gd | |
| ///pass desired php version as parameter for example 7.0 , 7.1 |