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
outp=(inp="<html>Documentation Permission is hereby granted, free of charge, to any person obtaining a copy of this Software and associated Documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</html> {:ABC:} , 123456.").replace(/([^A-Za-z0-9 ]+)/g, " {:$1:} ").replace(/([A-Z]+)/g," {:$1:} ").split(" ").map(function (it,n) { return it.length > 10 ? it.substring(0,10) + " {::} " + it.substring(10) : parseInt(it, 36) || it}) .join(" ").split(" ") .map(function(it,n) { return it.match(/^\d/) ? (+it).toString(36) : it }).join(" ").replace(/ \{\:([^a-z ]*)\:} /g, function(all,m) { return m.toUpperCase() }); [outp, inp == outp] |
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
#!/media/DATA/Mobile/git/josher19/LiveScript/bin/livescript | |
request = require 'request' | |
fs = require 'fs' | |
growl = require('growl') | |
docheck = (url, expectedTitle, cb = barf) -> | |
return (err, req, body) -> | |
try | |
return cb(err) if err; |
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() { | |
var pre, div, txt, desc, here = 0; | |
function startup() { | |
pre = document.body.querySelector('pre'); | |
txt = pre.innerText; | |
document.body.appendChild(div=document.createElement('div')); | |
div.innerHTML = txt; | |
div.style.display="none"; |
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
jQuery.fn.toObservable = jQuery.fn.toObservable || function (eventName, action) { | |
var dom = this; | |
return Rx.Observable.create(function(observer) { | |
var handler = function(ev) { | |
if (action !== undefined) { | |
action(ev); | |
} | |
else { | |
if (ev && ev.preventDefault) { | |
ev.preventDefault(); |
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
// Adds support for data-i18n and data-i18n-options to jQuery UI Dialog's title: | |
if( $.fn.dialog ) { // Checks the presence of the dialog component of jQuery UI | |
var rTitleKey = /\[title\]([^;]*);?/, | |
// Keep a reference to the original _create function: | |
dialog_create_orig = $.ui.dialog.prototype._create; | |
$.ui.dialog.prototype._create = function( ) { | |
var data_i18n, | |
i18n_options; | |
if(!this.options.title) { // Because as defined in Dialog, the options.title should override the title attribute | |
var old_data_i18n = this.element.attr( "data-i18n" ); |
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
/** Give documentation (via mouseover) in title attributes for functions in code highlighted with rainbowco.de */ | |
function minidoc(docs,funcs) { | |
funcs = funcs || document.querySelectorAll('code span.function') // Could also do 'code span.method' | |
for(var i=0, len=funcs.length; i<len; ++i) { | |
var t = docs[funcs[i].textContent]; | |
if (t) funcs[i].title = t; | |
} | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<base href="http://worrydream.com/Tangle/" target="_top" /> | |
<title>Tangle: Getting Started</title> | |
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'> | |
<link rel="stylesheet" href="Fonts/Insolent/stylesheet.css" type="text/css"> | |
<link rel="stylesheet" href="Fonts/BorisBlackBloxx/stylesheet.css" type="text/css"> |
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 Vector = (function () { | |
function Vector(x, y, z) { | |
this.x = x; | |
this.y = y; | |
this.z = z; | |
} | |
Vector.times = function times(k, v) { | |
return new Vector(k * v.x, k * v.y, k * v.z); |
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
// Surreal Number generation. Not exactly like Conway's version. | |
// 4 is [4]|[4] rather than [3]|[] | |
// so average of leftmost(left) and rightmost(right) is the value of the number | |
// | |
// Optimized for usage in Javascript and Node. | |
// TODO: Create Surreal class and github project. | |
function surreal_init(e) { | |
var left = [Math.floor(e)]; | |
var right = [Math.ceil(e)]; |
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 randomFrom(s0) { | |
return (1103515245 * s0 + 12345) % Math.pow(2,32); | |
} |