Skip to content

Instantly share code, notes, and snippets.

@ms88privat
ms88privat / sharp.config.js
Last active December 15, 2017 12:32
toMatchImageSnapshot (/w differencify)
import deasync from 'deasync';
import sharp from 'sharp';
sharp.prototype.toBufferSync = function(options) {
let done = false;
let returnValue;
this.toBuffer(options, (err, data, info) => {
if (err) throw err;
@ms88privat
ms88privat / gist:ce58ba4787407b757887
Created October 4, 2015 00:34 — forked from marty-wang/gist:5a71e9d0a6a2c6d6263c
Compile and deploy React Native Android app of Release version to device.
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
@ms88privat
ms88privat / yobuild.sh
Created April 15, 2014 19:47
yobuild hffinal
echo "Building Grunt Project.";
grunt build;
echo "change path to $HOME/dev/hfAppV01";
cd $HOME/dev/hfAppV01;
echo "Deleting files in ./www";
rm -rf ./www/*;
echo "Copying files from ../hffinal/static/dist/ to ./www";
@ms88privat
ms88privat / loading_spinner_directive.js
Last active August 29, 2015 13:57
ANGULAR DIRECTIVE loadingSpinner
'use strict';
/*
HOW TO USE:
-------------------------------------------------------------------------
DIRECTIVE (A):
<div hf-loading-spinner="loading" loading-type="{{ loadingType }}" [options="{ "lines": "20" }"]>
// insert content to display after loading is done
</div>
---------
@ms88privat
ms88privat / yobuild.sh
Created March 3, 2014 22:03
BUILD: yobuild.sh
echo "Building Grunt Project.";
cd ./yeoman/;
grunt build;
cd ../;
echo "Deleting files in ./www";
rm -rf ./www/*;
echo "Copying files from ./yeoman/dist to ./www";
cp -r ./yeoman/dist/* ./www/;
@ms88privat
ms88privat / loading_views.coffee
Created February 19, 2014 13:53
APP COMPONENT: loading_views.coffee
@hf.module "Components.Loading", (Loading, App, Backbone, Marionette, $, _) ->
class Loading.LoadingView extends App.Views.ItemView
template: "#loadingView"
className: "loading-container"
tagName: "div"
onRender: ->
opts = @_getOptions()
@$el.spin opts
@ms88privat
ms88privat / loading.coffee
Created February 19, 2014 13:52
APP COMPONENT: loading.coffee
@hf.module "Components.Loading", (Loading, App, Backbone, Marionette, $, _) ->
class Loading.LoadingController extends App.Controllers.Base
initialize: (options) ->
{ view, config } = options
config = if _.isBoolean(config) then {} else config
_.defaults config,
@ms88privat
ms88privat / home_page_views.coffee
Created February 19, 2014 12:47
APP: home_page_views.coffee
@hf.module "Home.Page", (Page, App, Backbone, Marionette, $, _) ->
class Page.Layout extends App.Views.Layout
template: '#home_page_layout'
# regions:
# loginRegion: "#loginRegion"
# registrationRegion: "#registrationRegion"
@ms88privat
ms88privat / home_page.coffee
Created February 19, 2014 12:46
APP: home_page.coffee
@hf.module "Home.Page", (Page, App, Backbone, Marionette, $, _) ->
class Page.Controller extends App.Controllers.Base
initialize: (options = {}) ->
{ } = options
@layout = new Page.Layout
@ms88privat
ms88privat / home.coffee
Created February 19, 2014 12:41
APP: home.coffee
@hf.module "Home", (Home, App, Backbone, Marionette, $, _) ->
@startWithParent = false
class Home.Router extends Marionette.AppRouter
appRoutes:
"home" : "page"
API =