Skip to content

Instantly share code, notes, and snippets.

View jas-'s full-sized avatar
🏃‍♂️

Jason Gerfen jas-

🏃‍♂️
View GitHub Profile
@pascaldekloe
pascaldekloe / utf8.js
Last active September 9, 2023 05:21
JavaScript UTF-8 encoding and decoding with TypedArray
// 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 October 11, 2012 18:03
iTunes Search API
var iTunes = (function() {
var endpoint = 'http://itunes.apple.com/search',
searchOptions = {
term: '',
country: 'US',
media: '',
entity: '',
attribute: '',
callback: 'iTunes.end',