Skip to content

Instantly share code, notes, and snippets.

View ThisIsMissEm's full-sized avatar

Emelia Smith ThisIsMissEm

View GitHub Profile
;(function(){
/**
* Class Template.
* This class is used for generating and rendering templates.
*/
var undefined;
var templater = this.templater = {
/**
* Renders a new template, given options.
dojo.dnd.isFormElement = function(e){
var t = e.target;
if(t.nodeType == 3 /*TEXT_NODE*/ || dojo.attr(t, "style") == "overflow: hidden;"){
t = t.parentNode;
}
return dojo.hasClass(t, "dijitTextBox") || " button textarea input select option ".indexOf(" " + t.tagName.toLowerCase() + " ") >= 0;
};
@ThisIsMissEm
ThisIsMissEm / gist:242732
Created November 25, 2009 14:18
A very basic daemon for Node.js
#! /bin/sh
CUR_DIR=$PWD
PID_FILE="$CUR_DIR/node.pid"
if [ $1 = "start" ]; then
if [ -e $PID_FILE ]; then
echo "Node.js is already running."
else
echo "Starting Node Server"
#!/bin/bash
user=""
domain=""
mount_path=""
local_path=""
if [ -d $local_path ]; then
if mount|grep $local_path; then
echo "Unmounting $local_path..."
jet.mixin = function(/*Object*/ target, /*Object*/ source){
for(var prop in source){
if(source.hasOwnProperty(prop) && (!(prop in target) || target[prop] !== source[prop])){
if(typeof source[prop] === "object"){
target[prop] = jet.mixin(target[prop], source[prop]);
} else {
target[prop] = source[prop];
}
}
}
SessionManager.prototype.cleanup = function(){
var sessionExpiration,
now = Date.now(),
next = Infinity;
sys.log("--- Cleaning Up. SessionStore Length:"+ size(this._sessionStore));
for(var sid in this._sessionStore){
if(Object.prototype.hasOwnProperty.call(this._sessionStore, sid)){
diff --git a/lib/sys.js b/lib/sys.js
index 9c4dc6d..827f81d 100644
--- a/lib/sys.js
+++ b/lib/sys.js
@@ -98,7 +98,7 @@ var formatter = function(value, indent, parents) {
});
} else {
return formatObject(value, indent, parents, '{}', function(x, f) {
- return f(x) + ': ' + f(value[x]);
+ return x + ': ' + f(value[x]);
//---------------------------------------
// Enhancing the HTTP Lib for cookies.
//---------------------------------------
// summary:
// - Adds getCookie method to the httpRequest object.
// - Adds setCookie and clearCookie methods to the httpResponse object.
// acknowledgements:
// Code based on http://github.com/jed/cookie-node/blob/master/cookie-node.js
<div id="grid">
<div class="gutter" style="left: 60px;"></div>
<div class="gutter" style="left: 80px;"></div>
<div class="gutter" style="left: 280px;"></div>
<div class="gutter" style="left: 300px;"></div>
<div class="gutter" style="left: 500px;"></div>
<div class="gutter" style="left: 520px;"></div>
<div class="gutter" style="left: 720px;"></div>
<div class="gutter" style="left: 740px;"></div>
<div class="gutter" style="left: 940px;"></div>
function set(/*String*/ namespace, /*Object?*/ properties, /*Mixed*/ value){
// summary:
// Creates & Resolves an objects structure based on the given Namespace string.
// namespace:
// A string representing an object tree, each level separated by a period.
// example:
// | namespace("a.b.c");
// | #=> a = {}; a.b={}; a.b.c={};
// example:
// | namespace("a.b.c", function(){});