Skip to content

Instantly share code, notes, and snippets.

View clemblanco's full-sized avatar
✌️

Clem Blanco clemblanco

✌️
View GitHub Profile
@adampax
adampax / titanium-array-form-next-key.js
Created October 20, 2011 17:59
Simple Titanium form saved in an array with return key eventlistener moving to the next field
Ti.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title : 'test'
});
var arrayLength = 5
var fields = new Array(arrayLength);
for( i = 0; i < arrayLength; i++) {
@joscandreu
joscandreu / kmlroutetomap
Created November 9, 2011 10:56
Get a kml from Google and add it to a Ti.Map view
//Credits to Vali Filip
var win=Titanium.UI.currentWindow;
Titanium.Geolocation.accuracy = Titanium.Geolocation.ACCURACY_BEST;
var origin1 = Titanium.UI.createSearchBar({
barColor:'#000',
showCancel:true,
height:40,
top:0,
@saetia
saetia / gist:1623487
Last active May 1, 2024 19:55
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@minhnc
minhnc / app.js
Created March 17, 2012 15:30
TableView - Custom SearchBar: Prefix Search, Customize No Result
var win = Ti.UI.createWindow({backgroundColor: 'white'});
var searchbar = Ti.UI.createSearchBar({ top: 0, height: 43, showCancel: false });
win.add(searchbar);
// Function to dump data
function dumpData() {
var data = [];
for(var i = 0; i < 20; i ++) {
data.push({title: Math.random().toString(36).substring(5)});
}
@tonylukasavage
tonylukasavage / index.xml
Created August 30, 2012 14:36
Alloy "platform" attribute
<Alloy>
<Window>
<!-- all platforms -->
<View/>
<!-- only on ios will this element, and all its subviews, appear -->
<View platform="ios">
<View/>
</View>
@r-sal
r-sal / PHPExcel_Basics.md
Last active May 8, 2024 06:29
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

@nfabre
nfabre / Symfony Live Paris.markdown
Last active October 7, 2020 12:27
Slides Symfony Live 2013
@ricardoalcocer
ricardoalcocer / index.js
Last active December 15, 2015 23:19
Android Holo Actionbar Alloy Sample Based on ideas by https://github.com/hoyo/ActionBarSample/tree/master/app
function doClickMenu(evt){
alert(evt.source.title);
}
// we need to do some things to the Window once it is properly instanciated, so we add an event listener to its OPEN event
$.win.addEventListener('open',function(){
var actionBar = $.win.activity.actionBar; // get a handle to the action bar
actionBar.title='My App'; // change the App Title
actionBar.displayHomeAsUp=true; // Show the "angle" pointing back
actionBar.onHomeIconItemSelected = function() { // what to do when the "home" icon is pressed
@kwhinnery
kwhinnery / howto.md
Created May 13, 2013 00:42
Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes.

Automatic TiShadow Installs

Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes. Edit your JS files in a text editor, save, then switch to the test device or simulator. Profit.

Install supervisor

[sudo] npm install -g supervisor

Execute tishadow run anytime a JavaScript file changes

@msurguy
msurguy / eloquent.md
Last active February 8, 2022 03:13
Laravel 4 Eloquent Cheat Sheet.

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';