This file contains hidden or 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
//functions.js | |
//f.rtconsole('generate.py build','/mnt/hda1/www/bursa/public/charts/generate.py',['build'],req,res,purl) | |
var tempstreams={}; | |
function rtconsole(streamname,command,command_args,req,res,purl) | |
{ | |
//var streamname='genbuild'; | |
//if(global.tempstreams===undefined)tempstreams={}; // ceate some global to store text and status | |
if(tempstreams[streamname]===undefined)tempstreams[streamname]={}; | |
var tempstream=tempstreams[streamname]; | |
if(tempstream.text===undefined)tempstream.text=""; |
This file contains hidden or 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
Date.prototype.isValid = function() { | |
if ( Object.prototype.toString.call(this) !== "[object Date]" ) | |
return false; | |
return !isNaN(this.getTime()); | |
} | |
//////////// |
This file contains hidden or 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
//TASKBAR CLASS | |
/** | |
* This class provides some well known operating system like taskbar | |
* behaviours. To every added window a toggle button is attached, that | |
* can switch the window between maximized and minimized state. | |
* | |
* *Example* | |
* | |
* Here is a little example of how to use the widget. |
This file contains hidden or 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
the basics of programming with callbacks: | |
structure: | |
function simple1(cb) // the last argument is callback function | |
{ | |
if(cb)return cb();// the return is required to prevent continuation of the function. | |
// the if(cb) is optional and it is to enable to omit the callback in rare cases. | |
// it is usually useful in api functions. | |
} |
This file contains hidden or 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
// ==UserScript== | |
// @name todo list in facebook | |
// @namespace http://kodtov.com | |
// @version 0.1 | |
// @description adds a todo list in top of facebook | |
// @include *facebook.com* | |
// @copyright 2013, Shimon Doodkin | |
// ==/UserScript== | |
// tinyxhr by Shimon Doodkin - licanse: public doamin - https://gist.github.com/4706967 |
This file contains hidden or 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
// this is not a main file the main file is opchart.js | |
var express = require('express') | |
// , routes = require('./routes') | |
// , user = require('./routes/user') | |
, path = require('path'); | |
sessionStore=false //defined on first time it could be catched from a request | |
app = express();//global |
This file contains hidden or 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
// tinyxhr by Shimon Doodkin - licanse: public doamin - https://gist.github.com/4706967 | |
// | |
// tinyxhr("http://site.com/ajaxaction",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data) }); | |
// tinyxhr("http://site.com/ajaxaction",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data) },'POST','value1=1&value2=2'); | |
// tinyxhr("http://site.com/ajaxaction.json",function (err,data,xhr){ if (err) console.log("goterr ",err,'status='+xhr.status); console.log(data); console.log(JSON.parse(data)) },'POST',JSON.stringify({value:1}),'application/javascript'); | |
// cb - a callback function like: function (err,data,XMLHttpRequestObject){ if (err) throw err; } | |
// | |
function tinyxhr(url,cb,method,post,contenttype) | |
{ |
This file contains hidden or 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
///////////////////////////merge arrays////// wrote by Shimon Doodkin///////// | |
/* | |
test mergin two arrays with common merging points | |
merge | |
[1,10:55] , | |
[2,10:55] , | |
[3,10:55] |
This file contains hidden or 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
/* | |
These next two functions work together to lock down bbPress forums based on PMPro membership level. | |
Check that the current user has access to this forum. Be sure to update the $restricted_forums array based on your needs. | |
*/ | |
function pmpro_check_forum() | |
{ | |
global $current_user; | |
/* |
This file contains hidden or 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 exit_redirect($url,$status){ //wp_redirect | |
//return wp_redirect($url,$status); // uncomment to temporarly disable | |
while(ob_get_level())ob_end_flush(); | |
if ( !$requested_url ) { | |
// build the URL in the address bar |