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 UnicodeToUTF8Array(UnicodeValue) {//Only 1 unicode value!!!!!! //Char Number Range as called from the RFC | |
//Converts Unicode number or character.toCharCodeAt() to an "UTF8 array" | |
//After this has been done, converting to UTF-8 is just trivial, just call UTF8ArrayToUTF8 | |
//JavaScript cannot "convert" strings to UTF-8 so we're just using byte arrays to save the information in case we need to save it to a file | |
/*Q:So why converting from Unicode to UTF-8 takes two functions? How is that a good Idea? | |
A:Well, I just thought that it could be really nice for debugging purposes, also knowing what the hell the String is converted to before being converted to*/ | |
var thearr = []; | |
if (UnicodeValue > 0x7FFFFFFF) { | |
throw new Error("Value cannot be greater than " + 0x7FFFFFFF); | |
/*You should remove this, if you don't like errors much, it will be annoying to enclose everything |
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
How to understand brainfuck? | |
It's easy, imagine a list, this lists has all it's values (contents) default to 0. | |
The length of the array (the list) depends on the system where brainfuck is run, in some systems it's a loop, in others the array can extend undefinetively | |
Now there are commands you use to change those values and move the pointer. | |
The pointer is the index of the array you're currently using. | |
There are 4 basic operators that are easy to learn | |
+ : Adds +1 on the index the pointer indicates | |
- : Decreases -1 on the index the pointer indicates |
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 getForm(asdf){ | |
var div=document.createElement('div'); | |
div.innerHTML=asdf; | |
return div.getElementsByTagName("form")[0]; | |
} | |
function removeElement(element){ | |
element&&element.parentNode.removeChild(element); | |
} | |
function HTTPRequestRetry(link,success,requesttype,post,headers,attemptsleft,failure){ |
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 makeElem(elem, attributes, childnodes) { | |
var e = document.createElement(elem),l; | |
for (var a in attributes) { | |
if (a == "style") { | |
for (var d in attributes[a]) { | |
e.style[d] = attributes[a][d]; | |
} | |
continue; | |
} | |
if (a == "__properties") { |
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
var Notify=function (w, d) { | |
'use strict'; | |
function Notify(title, options) { | |
if (typeof title !== 'string') { | |
throw new Error('Notify(): first arg (title) must be a string.'); | |
} |
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 Queue(){ | |
// initialise the queue and offset | |
this.queue = []; | |
this.offset = 0; | |
} | |
// Returns the length of the queue. | |
Queue.prototype.getLength = function(){ | |
return (this.queue.length - offset); | |
} |
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
//States | |
var states = [{ | |
'name': 'working', | |
'initial': true, | |
'events': { | |
'bored': 'coffee', | |
'call_for_meeting': 'meeting', | |
} | |
}, { | |
'name': 'coffee', |
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 getDups(){ | |
var outstring=""; | |
for(var i=0;i<dups.length;i++){ | |
console.log(g[dups[i]].post) | |
outstring+=Object.keys(g[dups[i]].dups).concat(g[dups[i]].post).map(function(a){return ">>"+a}).join('\n')+'\n\n'; | |
} | |
return outstring | |
} |
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
http://jsfiddle.net/z9b2m/44/show/ ?!?!?!?? | |
http://jsfiddle.net/ztfv652d/3/ | |
:D | |
Other jsfiddles: | |
http://jsfiddle.net/T7Srr/11/ | |
http://jsfiddle.net/gvKtN/6/show | |
http://jsfiddle.net/HbhXY/6/show/ | |
http://jsfiddle.net/upnMK/4/show/ |
OlderNewer