This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PubSub = (function (window) { | |
var uid, topics, ps; | |
// Unique ID that gets incremented with every subscription. | |
uid = 0; | |
// Objects subscribe to a specific topic so this data structure | |
// needs to be organized as a set of key-value pairs keyed to | |
// those topics. | |
topics = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isType(arg, type) { | |
type = type.charAt(0).toUpperCase() + type.substr(1); | |
return Object.prototype.toString.call(arg) == '[object ' + type + ']'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onerror = function(m,u,l){ | |
jQuery.post("ajax/js_error_log.php", | |
{ msg: m, | |
url: u, | |
line: l, | |
window: window.location.href }); | |
return true}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Simple JavaScript Inheritance | |
* By John Resig http://ejohn.org/ | |
* MIT Licensed. | |
*/ | |
// Inspired by base2 and Prototype | |
(function(){ | |
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
// The base Class implementation (does nothing) | |
this.Class = function(){}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function extend(obj, source) { | |
for (var key in source) { | |
obj[key] = source[key]; | |
} | |
} | |
// Example Usage | |
// Where Obj is a constructor with methods | |
extend(obj, (new Obj())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Example 1: Normal Template --> | |
<script type="text/html" id="item_tmpl"> | |
<div id="<%=id%>" class="<%=(i % 2 == 1 ? " even" : "")%>"> | |
<div class="grid_1 alpha right"> | |
<img class="righted" src="<%=profile_image_url%>"/> | |
</div> | |
<div class="grid_6 omega contents"> | |
<p><b><a href="/<%=from_user%>"><%=from_user%></a>:</b> <%=text%></p> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<project name="tutorialProject" default="prod" basedir="/Users/addy/buildTut/"> | |
<description>Client-side ANT build file example</description> | |
<target name="-load.properties" | |
description="Set properties for this build"> | |
<!--YUI Compressor location--> | |
<property name="yui.dir" value="${basedir}/yuicompressor/build/yuicompressor-2.4.2.jar"/> | |
<!--Source JS dir--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (!function_exists('json_encode')) { | |
function json_encode($data) { | |
switch ($type = gettype($data)) { | |
case 'NULL': | |
return 'null'; | |
case 'boolean': | |
return ($data ? 'true' : 'false'); | |
case 'integer': | |
case 'double': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Title Caps | |
* | |
* Ported to JavaScript By John Resig - http://ejohn.org/ - 21 May 2008 | |
* Original by John Gruber - http://daringfireball.net/ - 10 May 2008 | |
* License: http://www.opensource.org/licenses/mit-license.php | |
*/ | |
(function(){ | |
var small = "(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v[.]?|via|vs[.]?)"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Before using please rename from post-commit.sh to post-commit | |
# Add this file to the hooks directory in the svn root folder | |
REPOS="$1" | |
REV="$2" | |
# A - Item added to repository | |
# D - Item deleted from repository | |
# U - File contents changed |