Skip to content

Instantly share code, notes, and snippets.

View botmaster's full-sized avatar
🎧

Pascal Achard botmaster

🎧
View GitHub Profile
@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 / 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 / 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
{
// --------------------------------------------------------------------
// 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
// 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
@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": {}
@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 / CommonJS Fundamentals
Created November 8, 2013 10:52
The following code example shows all eight types of members and methods in one class; it also demonstrates which members are available to the different types of methods, and how they're accessed. Original post here : http://smorgasbork.com/index.php?option=com_content&view=article&id=132
var _privateStaticMember = 'PrSM';
function MyClass ()
{
var _privateInstanceMember = 'PrIM';
var _privateInstanceMethod = function ()
{
return _privateStaticMember + ','
+ _privateInstanceMember + ','
@botmaster
botmaster / app.tss
Created October 16, 2013 09:57 — forked from FokkeZB/app.tss
'Label[platform=android]': {
color: '#000' // all platforms except Android default to black
}
'Window': {
backgroundColor: '#fff' // white background instead of default transparent
}
'Window[platform=android]': {
modal: false // make android windows all heavyweight