Skip to content

Instantly share code, notes, and snippets.

View aaccurso's full-sized avatar
🦾
🦿

Alan Accurso aaccurso

🦾
🦿
View GitHub Profile
@aaccurso
aaccurso / 1. Foo.js
Last active July 2, 2017 03:03
Allow importing modules from the `src/` directory example.
// Location: src/components/deep/module/foo/Foo.js
import React, { Component} from 'react';
// We want to avoid importing modules relative to the current file
// import Bar from '../../../../bar/Bar.js';
// Instead we want to have a clearer way of importing modules relative to `src/`
import Bar from 'components/bar/Bar.js';
# Set PATHs
ANDROID_CORDOVA=platforms/android
# Create Ant release signing properties
echo "storeFile=$KEYSTORE
storePassword=$STOREPASS
keyAlias=$ALIAS_NAME
keyPassword=$KEYPASS" > $ANDROID_CORDOVA/release-signing.properties
# Build in release mode
# Install dependencies
npm install
bower install
# Bootstrap all source files with Browserify
grunt cordovaPrepare
# Create Ant release signing properties
echo "storeFile=$KEYSTORE
storePassword=$STOREPASS
# Check arguments
PROJECT_NAME=${1:-}
if [ -z $PROJECT_NAME ]; then echo "No project name provided!"; exit 1; fi
APPLICATION_APK=${2:-}
if [ ! -f $APPLICATION_APK ]; then echo "File does not exists or no file apk provided!"; exit 1; fi
# Configure gdrive CLI with permission file
GDRIVE="gdrive -c /home/${USER}/.gdrive"
@aaccurso
aaccurso / saveAvatarPicture
Created January 13, 2015 14:03
Usage of canvas2ImagePlugin
var saveAvatarPicture = function() {
var avatar = document.createElement('canvas'),
anchor;
avatar.width = 470;
avatar.height = this.game.height;
avatar.getContext('2d').drawImage(this.game.canvas,
180, 0,
avatar.width, avatar.height,
0, 0,
@aaccurso
aaccurso / gesture.js
Last active August 29, 2015 14:08 — forked from eguneys/gesture.js
'use strict';
define(['phaser'], function(Phaser) {
function Gesture(game) {
this.game = game;
this.swipeDispatched = false;
this.holdDispatched = false;
this.isTouching = false;
@aaccurso
aaccurso / install_plugins.js
Created August 19, 2014 01:37
before_prepare hook for cordova
#!/usr/bin/env node
var pluginlist = [
'org.apache.cordova.console',
'org.apache.cordova.device',
'org.apache.cordova.network-information',
'org.apache.cordova.file-transfer',
'org.apache.cordova.statusbar',
'org.apache.cordova.vibration',
'org.apache.cordova.dialogs',
'use strict';
angular.module('myApp.filters')
.filter('offset', function() {
return function(input, start) {
start = parseInt(start, 10);
return input.slice(start);
};
});
if ($_SERVER['REMOTE_ADDR']=='127.0.0.1') {
define('WP_ENV', 'local');
} elseif ($_SERVER['HTTP_HOST']=='develop.project.com') {
define('WP_ENV', 'develop');
} elseif ($_SERVER['HTTP_HOST']=='master.project.com') {
define('WP_ENV', 'develop');
} else {
define('WP_ENV', 'production');
}
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#