Skip to content

Instantly share code, notes, and snippets.

@botmaster
botmaster / .jshintrc
Last active January 2, 2016 02:18 — forked from tonylukasavage/.jshintrc
My JsHint config file for Titanium Alloy projects
{
"globals": {
"Ti": false,
"Titanium": false,
"Alloy": false,
"describe": false,
"it": false,
"before": false,
"beforeEach": false,
"after": false,
@botmaster
botmaster / .tern-project
Created January 10, 2014 13:16
My TernJS config file for Titanium Alloy projects
{
"libs": [
"titanium",
"ecma5",
"underscore"
],
"plugins": {
"requirejs": {
"baseURL": "./app",
"paths": {}
// Déclaration d'une classe
var MyClass = function (pParam1, pParam2)
{
// Scope fake publique
var that;
// Propriété privée
var _privateVar = 5;
// Méthode privée
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@botmaster
botmaster / Laravel create via composer
Created May 30, 2014 13:00
Laravel - create new project via composer
composer create-project laravel/laravel your-project-name --prefer-dist
@botmaster
botmaster / The Module Pattern
Last active August 29, 2015 14:10
http://www.addyosmani.com/resources/essentialjsdesignpatterns/book/#constructorpatternjavascript The module itself is completely self-contained in a global variable called basketModule. The basket array in the module is kept private and so other parts of our application are unable to directly read it. It only exists with the module's closure and…
var basketModule = (function () {
// privates
var basket = [];
function doSomethingPrivate() {
//...
}
@botmaster
botmaster / findViews.js
Created October 30, 2015 12:23 — forked from falkolab/findViews.js
Find views in view hierarchy that corresponded specified properties. Titanium Alloy.
var findViews = function(where, props, deep) {
var ctl = _.where(where.children, props);
if(deep){
return _.reduce(where.children, function(memo, view) {
return memo.concat(findViews(view, props, true));
}, ctl);
} else {
return ctl;
}
};
@botmaster
botmaster / cordova-plugin-guide.md
Created May 17, 2017 11:18 — forked from mlynch/cordova-plugin-guide.md
Cordova Plugin Developer Guide

Cordova Plugin Development Guide (iOS and Android)

Version: 0.0.1 updated 7/1/2016

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

Building Cordova plugins is scary for many Cordova and Ionic developers, but it doesn't have to be. This simple guide walks through the what, when, why, and how of Cordova plugin development for iOS and Android.

Introduction

@botmaster
botmaster / load-images.js
Created May 24, 2017 19:46 — forked from mattdesl/load-images.js
load images in parallel
function loadImage(url, callback) {
var image = new Image();
image.onload = function() {
callback(null, image);
};
image.onerror = function() {
callback(new Error('Could not load image at ' + url));
};
image.src = url;
}