Skip to content

Instantly share code, notes, and snippets.

@tsaniel
tsaniel / LICENSE.txt
Created July 16, 2011 14:07 — forked from 140bytes/LICENSE.txt
UTF8 encoder
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tsaniel
tsaniel / LICENSE.txt
Created July 17, 2011 07:37 — forked from 140bytes/LICENSE.txt
JSON stringify
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tsaniel
tsaniel / LICENSE.txt
Created July 20, 2011 09:10 — forked from 140bytes/LICENSE.txt
toCamelCase
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tsaniel
tsaniel / index.js
Created July 21, 2011 11:17
Unicode(UTF-16) to UTF-8
function(text) {
return text.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\u0000-\uD7FF\uE000-\uFFFF]/g, function($, offset) {
var isDoubleByte = $.length === 2
var unicode = isDoubleByte ?
(($.charCodeAt(offset) & 1023) << 10 | ($.charCodeAt(offset + 1) & 1023)) + 0x10000:
$.charCodeAt(offset);
return isDoubleByte ?
String.fromCharCode(
unicode >> 18 | 240,
unicode >> 12 & 63 | 128,
@tsaniel
tsaniel / LICENSE.txt
Created July 22, 2011 05:58 — forked from 140bytes/LICENSE.txt
isPrimeNumber (using RegExp)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tsaniel
tsaniel / LICENSE.txt
Created July 22, 2011 14:58 — forked from 140bytes/LICENSE.txt
solveAlgebraicEquation (using RegExp)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tsaniel
tsaniel / LICENSE.txt
Created September 2, 2011 12:17 — forked from 140bytes/LICENSE.txt
Konami Code easter egg
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tsaniel
tsaniel / LICENSE.txt
Created September 11, 2011 02:48 — forked from 140bytes/LICENSE.txt
The eight queens puzzle - get the number of soultions of an n queens puzzle
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tsaniel
tsaniel / LICENSE.txt
Created September 12, 2011 19:56 — forked from 140bytes/LICENSE.txt
The eight queens puzzle - get all the soultions
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@tsaniel
tsaniel / LICENSE.txt
Created October 5, 2011 10:05 — forked from 140bytes/LICENSE.txt
isWindow
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE