Skip to content

Instantly share code, notes, and snippets.

View ozexpert's full-sized avatar

Young K. Park ozexpert

  • UI / UX
  • Earth
View GitHub Profile
@ozexpert
ozexpert / ionic2.image-cache.directive.ts
Last active February 21, 2024 11:13
AngularJS2 / Ionic2 : ImageCache Directive to use with imgcache.js
import { Directive, ElementRef, Input } from '@angular/core';
declare var ImgCache: any;
@Directive({
selector: '[image-cache]'
})
export class ImageCacheDirective {
constructor (
private el: ElementRef
@ozexpert
ozexpert / fabfile.py
Last active August 29, 2015 14:07
Useful fabric to use with Ionic / Cordova application
from fabric.api import local, settings
from fabric.colors import red, green, yellow
from fabric.contrib.console import prompt
PACKAGE_NAME = 'YourProjectName'
DROPBOX_LOCATION = '~/Dropbox/YourLocation/'
BUILDER = 'YourId'
KEYSTORE = '~/someLocation/%(builder)s.keystore' % {'builder': BUILDER}
APK_LOCATION = 'platforms/android/bin/'
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js http://example.com
*/
var casper = require("casper").create();
@ozexpert
ozexpert / cordovaReadyFactory.js
Created February 28, 2014 16:14
Super useful cordova ready factory (same as device ready in Cordova)
YourModule.factory('CordovaReady', function() {
return function (fn) {
var queue = [];
var impl = function () {
queue.push(Array.prototype.slice.call(arguments));
};
document.addEventListener('deviceready', function () {
queue.forEach(function (args) {
@ozexpert
ozexpert / notificationFactory.js
Last active August 29, 2015 13:56
AngularJS / Cordova Notification Service for device & web (Cordova Ver 3.3.0)
YourModule.factory('Notification', function($rootScope){
return {
alert: function(message, callback){
if(navigator.notification !== undefined){
navigator.notification.alert(message,
function(){
$rootScope.$apply(callback());
});
} else {
alert(message);