Skip to content

Instantly share code, notes, and snippets.

View Qvatra's full-sized avatar

Oleksandr Zinchenko Qvatra

View GitHub Profile
@Qvatra
Qvatra / gist:e874ded68b2a640a3f10
Last active August 29, 2015 14:10
Ionic development: shellinit.bat
@rem This script configures some settings for command line development with local node_modules
@rem Add the node_modules\.bin folder (found with 'npm bin') to the path
@cd %~dp0
@for /f %%i in ('npm bin') do set PATH=%%i;%PATH%
@rem make sure everything is installed
call npm install
call bower install
call tsd update
@Qvatra
Qvatra / gist:b227f2a01e7cddf6b04d
Created November 28, 2014 13:44
Ionic development: .gitignore
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
node_modules/
platforms/
plugins/
www/lib/
www/typings/
# Output folders
@Qvatra
Qvatra / gist:22e5c797d50a0664af0a
Created November 28, 2014 14:19
ionic development: hooks/after_prepare/030_resource_files.js
#!/usr/bin/env node
//
// This hook copies various resource files from our version control system directories into the appropriate platform specific location
//
// From: http://docs.phonegap.com/en/3.5.0/config_ref_images.md.html#Icons%20and%20Splash%20Screens (sizes wrong, corrected below)
// - Default-568h@2x~iphone.png (640x1136 pixels)
// - Default-Landscape@2x~ipad.png (2048x1536 pixels)
// - Default-Landscape~ipad.png (1024x748 pixels)
@Qvatra
Qvatra / gist:a271bf47fbdbc51aab4f
Created November 28, 2014 14:51
ionic development: gulpfile.js
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var sh = require('shelljs');
var typescript = require('gulp-tsc');
var ngAnnotate = require('gulp-ng-annotate');
var uglify = require("gulp-uglify");
@Qvatra
Qvatra / gist:4c346b4944c2de736b44
Created December 1, 2014 12:53
ionic development: gulpfile.js
var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var sh = require('shelljs');
var typescript = require('gulp-tsc');
var ngAnnotate = require('gulp-ng-annotate');
var uglify = require("gulp-uglify");
@Qvatra
Qvatra / gist:e9a198e98f29897ffbf5
Created December 1, 2014 15:28
ionic development: app.ts
/// <reference path="_reference.ts"/>
interface IAppRootScopeService extends ng.IRootScopeService {
online: boolean;
lastScrollTimestamp: number;
isScrolling: () => boolean;
onScroll: () => void;
}
var myApp: ng.IModule = angular.module("angularApp", [
@Qvatra
Qvatra / gist:270081b04793cfe86c59
Created December 1, 2014 15:41
ionic development: MyController.ts
/// <reference path='../_reference.ts'/>
interface IMyControllerScope extends ng.IScope {
vm: IMyController; // now our view model (vm) in the scope is typed
}
interface IMyController {
myString: string;
myFunction: (arg) => boolean;
}
@Qvatra
Qvatra / gist:1f6e9c5eafa0e532d931
Created December 1, 2014 15:44
ionic development: MyService.ts
/// <reference path='../_reference.ts'/>
module myNameSpace {
"use strict";
export class MyServiceClassName {
public static $inject = [
"$log"
];
@Qvatra
Qvatra / gist:a6a5c488b991c71a560d
Created December 1, 2014 15:46
ionic development: bindOnce.ts
/// <reference path='../../typings/angularjs/angular.d.ts' />
interface IMyDirectiveScope extends ng.IScope {
bookmarker: string;
}
angular.module('directive.bindonce', [])
.directive('bindOnce', function () {
return {
restrict: 'A',
scope: true,
@Qvatra
Qvatra / gist:db825eae720c70c0c88a
Created December 8, 2014 13:56
ionic development: build.js
var fs = require('fs');
var path = require('path');
var exec = require('child_process').exec;
var archiver = require('archiver'); //npm install archiver
var prompt = require('prompt'); //npm install prompt
var appVersion;
var androidStoreVersion;
var device;
var mode;