Skip to content

Instantly share code, notes, and snippets.

View botmaster's full-sized avatar
🎧

Pascal Achard botmaster

🎧
View GitHub Profile
// 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;
}
};
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
@botmaster
botmaster / alloy.js
Created October 16, 2013 09:06 — forked from FokkeZB/alloy.js
// For iOS7 only, set the window's top to 20 so they start under the status bar.
Alloy.Globals.windowTop = (OS_IOS && parseInt(Ti.Platform.version[0], 10) >= 7) ? 20 : 0;
@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
@botmaster
botmaster / app.js
Created October 16, 2013 09:08 — forked from FokkeZB/app.js
http://developer.android.com/guide/topics/resources/providing-resources.html#ScreenAspectQualifier
if ((Ti.Platform.displayCaps.platformWidth / Ti.Platform.displayCaps.platformHeight) < (((Ti.Gesture.orientation === Ti.UI.LANDSCAPE_LEFT)) ? (320 / 240) : (240 / 320)))) {
Ti.API.info('I am LONG');
} else {
Ti.API.info('I am NOTLONG');
}
@botmaster
botmaster / app.tss
Created October 16, 2013 09:11 — 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