Skip to content

Instantly share code, notes, and snippets.

View r37r0m0d3l's full-sized avatar

Anton Trofymenko r37r0m0d3l

View GitHub Profile
<?php
/**
* Class Chainable
* Wrapper for convenient chaining methods
*
* @author Stefano Azzolini <[email protected]>
*/
class Chainable {
private $instance = null;
/*
* Lets you use your browser's back/forward buttons for in-page navigation by
* adding custom 'next' and 'previous' events to the window object.
*
* Copyright (c) 2011 Tobias Schneider <[email protected]>
* This script is freely distributable under the terms of the MIT license.
*
* Example:
*
* window.addEventListener('next', function(){
<?php
/**
* Class Chainable
* Wrapper for convenient chaining methods
*
* @author Stefano Azzolini <[email protected]>
*/
class Chainable {
private $instance = null;
<?php
/**
* cURL Object Oriented API
* @author Stefano Azzolini <[email protected]>
*/
class cURL {
/**
* The cURL resource descriptor
* @var Resource
<?php
/**
* Event class
* A module class for handling events
*
* @author Stefano Azzolini <[email protected]>
*/
class Events {
/**
<?php
set_error_handler(function(){ echo "INTERNAL\n"; });
function chain_error_handler($new_handler){
$old_handler = set_error_handler(function() use (&$old_handler,$new_handler){
call_user_func_array($new_handler,func_get_args());
call_user_func_array($old_handler,func_get_args());
});
var point, pointStartX, pointStartY, deltaX, deltaY;
var scroller = new iScroll('scrollerId', {
vScroll: false,
vScrollbar: false,
hScrollbar: false,
snap: 'li',
momentum: false,
onBeforeScrollStart: function(e) {
point = e.touches[0];
pointStartX = point.pageX;
// jQuery Headers support for $.ajax
$.ajax({
beforeSend: function(xhrObj){
xhrObj.setRequestHeader("Content-Type","application/json");
xhrObj.setRequestHeader("Accept","application/json");
}
type: "POST",
url: "/article",
processData: false,
/*
I wasn't happy with PhoneGap's Storage API and made it cleaner (in my eyes anyway)
Example:
db.query("someTable", ['id', 'column1', 'column2'], false, function(tx, results){ .. });
db.query("someTable", ['*'], {'column1':'val', 'column2':'val'}, function(tx, results){ .. });
db.save("someTable", IterableObject, function(){ ... });
Doing more testing and validation later, but getting it out there now. :)
*/
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/