Skip to content

Instantly share code, notes, and snippets.

Avatar
🏃‍♂️

Jason Gerfen jas-

🏃‍♂️
View GitHub Profile
@pascaldekloe
pascaldekloe / utf8.js
Last active May 10, 2021
JavaScript UTF-8 encoding and decoding with TypedArray
View utf8.js
// This is free and unencumbered software released into the public domain.
// Marshals a string to an Uint8Array.
function encodeUTF8(s) {
var i = 0, bytes = new Uint8Array(s.length * 4);
for (var ci = 0; ci != s.length; ci++) {
var c = s.charCodeAt(ci);
if (c < 128) {
bytes[i++] = c;
continue;
@jakiestfu
jakiestfu / iTunes.js
Created Oct 11, 2012
iTunes Search API
View iTunes.js
var iTunes = (function() {
var endpoint = 'http://itunes.apple.com/search',
searchOptions = {
term: '',
country: 'US',
media: '',
entity: '',
attribute: '',
callback: 'iTunes.end',