Shimon Doodkin shimondoodkin

View app.js
1 2 3 4 5 6 7 8 9 10
var express = require('express'),
passport = require('passport'),
GoogleStrategy = require('passport-google').Strategy,
connect = require('express/node_modules/connect'),
http = require('http'),
path = require('path'),
util = require('util'),
fs = require('fs'),
redis = require('redis'),
cookie = require('cookie'),
View app.js
1 2 3 4 5 6 7 8 9 10
var express = require('express'),
passport = require('passport'),
LocalStrategy = require('passport-local').Strategy,
connect = require('connect'),
http = require('http'),
path = require('path'),
util = require('util'),
fs = require('fs'),
redis = require('redis'),
cookie = require('cookie'),
View tinyxhr.js
1 2 3 4 5 6 7 8 9 10
/* based off of tinyxhr by Shimon Doodkin - license: public doamin - https://gist.github.com/4706967
 
Added ontop of Simon's code:
- Serialization of the object
- Moved some arguments to line up with jQuery( url, data, callback )
- Will attempt to parse JSON from the response if it's valid JSON
- Added a tinyPost and tinyGet method
 
Some other things that'd be good:
- Seprate error callback for failed responses
View SearchAndReplaceInText.cs
1 2 3 4 5 6 7 8 9 10
/*
references:
 
WindowsBase
Open XML Format SDK 2.5 - from NuGet
*/
 
using System;
using System.Collections.Generic;
using System.Linq;
View goals.md

The plan is to take a simple nodejs server. and add to it simple file serving capabilities. also to have a custom responce to a certien url. to be able to make a simple api in addition of serving files.

goals:

  • to learn read the documentation
  • to understand the whole concept
  • to use some api for hands on expirience
  • streach goal: learn basic npm usage.
View rtconsole.js
1 2 3 4 5 6 7 8 9 10
//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="";
View datefunctions.js
1 2 3 4 5 6 7 8 9 10
Date.prototype.isValid = function() {
if ( Object.prototype.toString.call(this) !== "[object Date]" )
return false;
return !isNaN(this.getTime());
}
 
 
 
 
////////////
View Taskbar.js
1 2 3 4 5 6 7 8 9 10
//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.
View 1-callback basics tutorial.js
1 2 3 4 5 6 7 8 9 10
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.
}
 
to make a function asynchronous capble:
View todo list in facebook.tamper.js
1 2 3 4 5 6 7 8 9 10
// ==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
Something went wrong with that request. Please try again.