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 Line(from, to, color, thickness) | |
{ | |
this.from = from || { x: 0, y: 0 }; | |
this.to = to || { x: 100, y: 100 }; | |
// Aliases for from and to | |
this.p1 = this.from; | |
this.p2 = this.to; | |
this.color = color || 'black'; |
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 sineBetween(min, max, t) | |
{ | |
var halfRange = (max - min) / 2; | |
return min + halfRange + Math.sin(t) * halfRange; | |
} | |
function cosineBetween(min, max, t) | |
{ | |
var halfRange = (max - min) / 2; | |
return min + halfRange + Math.cos(t) * halfRange; |
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 toCharcodes(str) | |
{ | |
var codestring = ''; | |
var comma = ''; | |
for(var i = 0; i < str.length; i++) | |
{ | |
comma = (i === str.length-1) ? '' : ','; | |
codestring += str.charCodeAt(i) + comma; | |
} |
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
* | |
{ | |
margin: 0; | |
padding: 0; | |
} | |
html, body | |
{ | |
width: 100%; | |
height: 100%; |
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
// Result: http://puu.sh/j19yl/d37b20ff08.png | |
this.position = | |
{ | |
x: self.vpc.x + Math.cos(time * 0.002) * this.helpers.sineBetween(-200, 200, time * 0.02), | |
y: self.vpc.y + Math.sin(time * 0.002) * this.helpers.sineBetween(200, 200, time * 0.02) | |
} | |
this.viewportsize = viewportsize; | |
this.vpc = { x: this.viewportsize.w / 2, y: this.viewportsize.h / 2 }; // Viewportcenter |
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
this.position = Victor.fromObject( | |
{ | |
x: self.vpc.x + Math.cos(time * 0.002) * self.helpers.sineBetween(10, 250, time * 0.002), | |
y: self.vpc.y + Math.sin(time * 0.002) * self.helpers.sineBetween(-100, 250, time * 0.002) | |
}); |
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
this.position = Victor.fromObject( | |
{ | |
x: self.vpc.x + Math.cos(time * 0.002) * self.helpers.sineBetween(-100, 100, time * 0.0002), | |
y: self.vpc.y + Math.sin(time * 0.002) * self.helpers.sineBetween(100, 100, time * 0.002) | |
}); |
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
$(document).on('keypress', function(e) | |
{ | |
// Evaluate keycode into a lowercase human-readable letter | |
var key = String.fromCharCode(e.charCode).toLowerCase(); | |
// Figure what to do with each key | |
switch(key) | |
{ | |
case 'a': | |
console.log('a pressed'); |
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
$(document).ajaxSend(function(event, request, settings) | |
{ | |
console.log('Caught AJAX request!'); | |
console.log(event); | |
console.log(request); | |
console.log(settings); | |
}); |
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 crx DL link | |
* @description prompt crx download-link on Chrome Web Store | |
* @include https://chrome.google.com/webstore/detail/* | |
* @contributor taizooo http://let.hatelabo.jp/taizooo/let/gYC-x-e5r_G0bw (Fork of) | |
* @contributor noromanba http://let.hatelabo.jp/noromanba/let/hLHX5-ST-aMn | |
* @license MIT License http://opensource.org/licenses/MIT | |
* @javascript_url | |
*/ |
OlderNewer