Skip to content

Instantly share code, notes, and snippets.

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/
// 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;
@osadan
osadan / introrx.md
Created January 31, 2017 10:35 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@osadan
osadan / gist:27843850be4a5d78b4131b713b2db19c
Last active March 21, 2022 09:21
npm next release publish
npm version prerelease --preid=next
npm publish --tag=next
@osadan
osadan / git-branch.txt
Created March 21, 2022 09:25
detect chnaged folders from git commi
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)"
@osadan
osadan / store.js
Created March 23, 2022 08:50
one store for multiple package instances
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: [],
@osadan
osadan / replace_env.sh
Created December 25, 2022 13:41
sed code to switch .env attributes
#!/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
@osadan
osadan / commands.sh
Last active December 28, 2022 08:34
useful linux shell commands
# 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