Skip to content

Instantly share code, notes, and snippets.

Avatar

Iñaki Abete inakiabt

View GitHub Profile
@smajda
smajda / aggregate-feed.php
Created Oct 7, 2009
Merge multiple RSS feeds with SimplePie
View aggregate-feed.php
<?php
/* Merge multiple RSS feeds with SimplePie
*
* Just modify the path to SimplePie and
* modify the $feeds array with the feeds you want
*
* You should probably also change the channel title, link and description,
* plus I added a CC license you may not want
*
* Help from: http://www.webmaster-source.com/2007/08/06/merging-rss-feeds-with-simplepie/
@jeffrafter
jeffrafter / handler.js
Created Apr 2, 2010
Simple HTTP Server and Router in node.js
View handler.js
exports.createHandler = function (method) {
return new Handler(method);
}
Handler = function(method) {
this.process = function(req, res) {
params = null;
return method.apply(this, [req, res, params]);
}
}
View paginated_collection.js
// includes bindings for fetching/fetched
var PaginatedCollection = Backbone.Collection.extend({
initialize: function() {
_.bindAll(this, 'parse', 'url', 'pageInfo', 'nextPage', 'previousPage');
typeof(options) != 'undefined' || (options = {});
this.page = 1;
typeof(this.perPage) != 'undefined' || (this.perPage = 10);
},
fetch: function(options) {
@coomsie
coomsie / validation.js
Created May 5, 2011
form validation for titaniuim mobile projects
View validation.js
//UI for valiation
function validationMessages() {
//*** 'me' acts as an alias that can be used within the methods
var me = this;
var imgPath=Ti.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory,"images/bubble.png");
validationMessages.totalErrors =0;
validationMessages.reqdfieldsRemaining=0;
@matoakley
matoakley / gist:1092571
Created Jul 19, 2011
MySQL to convert a string into a slug
View gist:1092571
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`
@kwhinnery
kwhinnery / parse.js
Created Aug 27, 2011
A Parse client for Titanium Mobile - sneak peek
View parse.js
//Public client interface
function Client(applicationId, masterKey) {
this.applicationId = applicationId;
this.masterKey = masterKey;
}
exports.Client = Client;
//Parse API endpoint
var ENDPOINT = 'https://api.parse.com/1/classes/';
@jeffbonnes
jeffbonnes / tracer.js
Created Sep 12, 2011
A tracer object to Titanium Mobile to show elapsed time and memory usage
View tracer.js
var tracer = {};
(function() {
tracer.levels = {};
tracer.levels.DEBUG = 1;
tracer.levels.INFO = 2;
tracer.levels.WARN = 3;
tracer.levels.ERROR = 4;
tracer.levels.OFF = 5;
tracer.allTracers = [];
View slugify.js
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@tzmartin
tzmartin / gist:1372475
Created Nov 17, 2011
UIModule Error Hack
View gist:1372475
/*
* This is a hack solves the "Invalid method passed to UIModule" error
* It works by forcing Titanium to load SDK components into memory.
*
* Drop this file anywhere in your project and DON'T Ti.include() it.
* Be sure this file extension is .js.
* Clean and recompile your project.
*
* Enjoy!
* @tzmartin
View scrollViewFragment
var win = Ti.UI.createWindow({
title : 'Profile'
});
var mainViewHeight = Ti.Platform.displayCaps.platformHeight
- ClubTonight.ui.defaults.iphone.statusBarHeight
- ClubTonight.ui.defaults.iphone.navBarHeight
- ClubTonight.ui.defaults.iphone.tabBarHeight;
var scrollView = Titanium.UI.createScrollView({
top : 0,
contentWidth : Ti.Platform.displayCaps.platformWidth,
You can’t perform that action at this time.