Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jakubgg
jakubgg / Readme.md
Last active April 7, 2017 21:15
Titanium hack to add search icon to sectionIndexTitles in ListView for iOS

#Purpose I was struggling with sectionIndexTitles in Titanium. I wanted to mimic the functionality of having the 'search icon' on top of my index bar on the right hand side of the listView, that would additionaly scroll all the way back to the searchBar. So after a couple of hours of poking here and there and using a bigger hammer when I was in doubt, I came up with this quick hack.

#Solution Download TiUIListView-searchIcon.patch.

Navigate to your Titanium SDK files (~/Library/Application Support/Titanium/mobilesdk/osx/3.2.3.GA/iphone/Classes/).

Drop the patch file there.

@jakubgg
jakubgg / build_version.sh
Created May 30, 2014 12:21
Titanium automatic build version helper
#!/usr/bin/env node
var fs = require('fs');
fs.readFile('./tiapp.xml', 'utf8', function (err, data) {
if (err) throw err;
incrementBuild(data);
});
function incrementBuild (data) {
var lastBuild = data.match(/(?!name="build">)[0-9]+(?=<\/property>)/);
@jakubgg
jakubgg / ngglinkinject.js
Last active December 29, 2015 17:29
Inject link and redirect for specific slide for Wordpress NextGEN gallery
window.requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame;
/**
* Inject link and redirect for specific slide for Wordpress NextGEN gallery
* (c) 2013 Code Lens | Jakub Gadkowski
* Licenced under Creative Commons Attribution 4.0 International Public License http://creativecommons.org/licenses/by/4.0/
*/
window.addEventListener('load', function(){
@jakubgg
jakubgg / testlocalstorage.js
Last active December 15, 2015 19:29
JavaScript function to test (a bit brute force test) how much space is allocated for localStorage in a browser, if there are already entries in the localStorage it will show how much space is left.
/**
* Function to test how much space is allocated for localStorage in a browser,
* if there are already entries in the localStorage it will show how much space is left.
* console.logs commented out because IE is tripping over them.
*/
function testLocalStorage(){
var timeStart = Date.now();
var timeEnd, countKey, countValue, amountLeft, itemLength;
var occupied = leftCount = 0;
//create localStorage entries until localStorage is totally filled and browser issues a warning.