Skip to content

Instantly share code, notes, and snippets.

@goliatone
goliatone / README.md
Created June 3, 2012 13:41 — forked from melanke/README.md
watch the changes of some object or attribute

Watch.js

About

Watch.JS is a small library that brings a lot of possibilities. Maybe you know the design pattern called "Observer", imagine the possibility of executing some function always that some object changes. Well, already exists other libraries that do this, but with Watch.JS you will not have to change your way to develop. Give a chance to Watch.JS, take a look at the examples and how is simple to embody Watch.JS to your routine.

Observe the changes of one object attribute

//defining our object no matter which way we want
@goliatone
goliatone / TileLayer.TileJSON.js
Created October 22, 2012 21:57 — forked from idolmind/TileLayer.TileJSON.js
Leaflet TileCanvas
L.TileLayer.TileJSON = L.TileLayer.Canvas.extend({
options: {
debug: false
},
tileSize: 256,
initialize: function (options) {
L.Util.setOptions(this, options);
@goliatone
goliatone / logger.js
Created November 7, 2012 23:11 — forked from shiftb/logger.js
A simple javascript logger
/*!
* Javascript Logger
* https://gist.github.com/gists/902014
*
* Copyright 2011, Brandon Leonardo
*/
var Logger = function(options) {
var opts = options || {};
this.debugMode = opts['debugMode'] || false;
@goliatone
goliatone / gist:4062015
Created November 12, 2012 21:26 — forked from lucasmezencio/gist:2788630
HTML5 Snippet for Sublime Text 2
<snippet>
<content><![CDATA[
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
@goliatone
goliatone / profile.php
Created November 18, 2012 04:47 — forked from supernifty/profile.php
Ultra Simple PHP Profiler
<?php
$_start = 0;
$_subdata = '';
function profile_start() {
global $profile;
if ( $profile ) {
global $_start, $_subdata;
$_start = microtime(true);
$_subdata = '';
(function ($) {
var compiled = {};
$.fn.handlebars = function (template, data) {
if (template instanceof jQuery) {
template = $("<div />").append($(template).clone()).html();
}
compiled[template] = Handlebars.compile(template);
this.html(compiled[template](data));
};
})(jQuery);

Intro

Description: Setup GitHub Pages "gh-pages" branch and "master" branch as subfolders of a parent project folder ("grandmaster").

Author: Chris Jacob @_chrisjacob

Tutorial (Gist): https://gist.github.com/833223

The Result

These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):

  1. Install Raspbian - http://www.raspberrypi.org/downloads

  2. Install the necessary dependecies:

sudo apt-get install git-core build-essential

(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)

These instructions work for the Raspberry Pi running Raspbian (hard float) and create a hardware optimized version of NodeJS for the Raspberry PI, (and include a working install and NPM!!!):

  1. Install Raspbian - http://www.raspberrypi.org/downloads

  2. Install the necessary dependecies:

sudo apt-get install git-core build-essential

(If you just installed git then you need to administer your git identity first, else adding the patches below will fail!!!)

<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.