Skip to content

Instantly share code, notes, and snippets.

View msenkpiel's full-sized avatar
👻

Marco ± msenkpiel

👻
View GitHub Profile
@jacob414
jacob414 / backbone-tutorial.js
Created November 18, 2010 12:54
Minimal example of data handling in Backbone.js
/* Scaled-down Backbone.js demonstration
* By Jacob Oscarson (http://twitter.com/jacob414), 2010
* MIT Licenced, see http://www.opensource.org/licenses/mit-license.php */
$(function() {
window.ulog = function(msg) { $('#log').append($('<div>'+msg+'</div>')); }
// Faking a little bit of Backbone.sync functionallity
Backbone.sync = function(method, model, succeeded) {
ulog('<strong>'+method + ":</strong> " + model.get('label'));
if(typeof model.cid != 'undefined') {
<?php
require __DIR__.'/vendor/facebook/src/facebook.php';
$app_id = '1234567890';
$secret = '0123456789abcdef0123456789abcdef0123456789abcdef';
$fb = new Facebook(array(
'appId' => $app_id,
'secret' => $secret,
@kylebarrow
kylebarrow / example.html
Created June 23, 2011 06:30
Prevent links in standalone web apps opening Mobile Safari
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@irae
irae / _Stay_standalone.md
Last active January 29, 2024 12:38 — forked from kylebarrow/example.html
Stay Standalone: Prevent links in standalone web apps opening Mobile Safari

#Stay Standalone

A short script to prevent internal links to a "webapp" added to iPhone home screen to open in Safari instead of navigating internally.

@bastman
bastman / MySQLIDB Example
Created November 6, 2011 20:06
MySQLi simple dbclient standalone php
//Example
//=======
ini_set("display_errors", true);
error_reporting(E_ALL|E_STRICT & ~E_NOTICE);
set_error_handler(function($errno, $errstr, $errfile, $errline){
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
});
$db = MySQLiDB::getInstance();
@bastman
bastman / gist:1344759
Created November 7, 2011 11:46
simple jsonrpc server howto php
the request ...
================
{
"method":"foobar",
"params":["foo", "bar", "baz"]
}
@bastman
bastman / JsonRpc Client (js)
Created November 10, 2011 12:57
advanced json-rpc server (php)
JS Client using jquery ajax and json2.js
========================================
App.invokeRpc = function(method, params, callback)
{
var rpc = {
method:method,
params:params
};
@bastman
bastman / CallbackVO.as
Created November 16, 2011 19:09
jsonrpc client (as3)
package com.application.rpc
{
/**
* ...
* @author seb
*/
public dynamic class CallbackVO extends Object
{
@fightbulc
fightbulc / gist:1373235
Created November 17, 2011 14:17
icanhaz updated with mustache 0.4.0-dev
/*!
ICanHaz.js version 0.9 -- by @HenrikJoreteg
More info at: http://icanhazjs.com
*/
(function($) {
/*
mustache.js — Logic-less templates in JavaScript
See http://mustache.github.com/ for more info.
*/
@paulirish
paulirish / rAF.js
Last active July 19, 2024 19:50
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];