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 point2(x, y) | |
{ | |
return {'x': x || 0, 'y': y || 0}; | |
} | |
function vector2(x, y) | |
{ | |
return {'x': x || 0, 'y': y || 0}; | |
} |
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
var rotate_image_panel = function(degrees) | |
{ | |
this.draw = function(context, rect, user) | |
{ | |
//http://jsfiddle.net/reportbase/z0v2w3ww/ | |
context.save(); | |
context.translate(rect.width/2,rect.height/2); | |
context.rotate(degrees*Math.PI/180); | |
context.drawImage(image,-image.width/2,-image.width/2); | |
context.restore(); |
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 point(x, y) | |
{ | |
this.x = x; | |
this.y = y; | |
} | |
function distance(a, b) | |
{ | |
var x = a.x - b.x; |
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
"<div id='parentdiv' style='display: block; position: absolute; left: 0; top: 0; z-index: 10'></div>"+ | |
"<div id='editdiv' contentEditable style='outline: 0px solid transparent; overflow: auto; display; z-index: 11'></div>"+ | |
parentdiv.appendChild(editdiv); | |
var left = (window.innerWidth - 320)/2; | |
var top = (window.innerHeight - 80)/2; | |
parentdiv.style.top = top+"px"; | |
parentdiv.style.left = left+"px"; | |
parentdiv.style.width = 320; | |
parentdiv.style.height = 80; | |
parentdiv.style.lineHeight = 80; |
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
[0, clr.SUBHEADER, "Bitly User Info", function() | |
{ | |
var http = new XMLHttpRequest(); | |
http.open("GET", "https://api-ssl.bitly.com/v3/user/info?access_token=" + global.bitfly_access_token); | |
http.responseType = "json"; | |
http.onreadystatechange = function(){if (this.readyState == this.DONE) console.log(this.response);}; | |
http.send(); | |
}], | |
[0, clr.SUBHEADER, "Bitly Link Info", function() |
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
app.get('/session.admin',function(req, res) | |
{ | |
if(req.session.email) | |
{ | |
res.write('<h1>Admin '+ req.session.email +'</h1>'); | |
res.end('<a href="/logout">Logout</a>'); | |
} | |
else | |
{ |
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
var driveobject = (function () | |
{ | |
function init() | |
{ | |
this.key = "driveobject"; | |
var t = this; | |
t.data = new Array(); | |
var http = new XMLHttpRequest(); |
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
var readable = fs.createReadStream('data'); | |
readable.setEncoding('utf8'); | |
readable | |
.on('data', function (data) { console.log('Data!', data); }) | |
.on('error', function (err) { console.error('Error', err); }) | |
.on('end', function () { console.log('All done!'); }); | |
### | |
var readable = fs.createReadStream('a.txt'), | |
writable = fs.createWriteStream('b.txt'); |
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 nug() | |
{ | |
var panel = function() | |
{ | |
this.tap = function(context, rect, x, y) | |
{ | |
if (func && this.rect.hitest(x, y)) | |
func(); | |
escape(); | |
} |
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
{ | |
name:"Candle Glance", | |
title:"Candle Glance - stockcharts.com", | |
hit: function() | |
{ | |
var str = _.pluck(watchobj.data,'name').join('%2C') | |
window.open('http://stockcharts.com/freecharts/candleglance.html?'+str,'_self') | |
} | |
}, | |
{ |