Skip to content

Instantly share code, notes, and snippets.

@ireeymonse
ireeymonse / EmojiFromObject.swift
Last active June 9, 2020 16:51
Generate an emoji using an object's memory address.
import Foundation
// 1056 emoji in the range
let emoji: [UnicodeScalar] = (0x1F300...0x1F9FF).compactMap {
if let scalar = UnicodeScalar($0), scalar.properties.isEmoji { // see also: isEmojiPresentation
return scalar
}
return nil
}
@ireeymonse
ireeymonse / HexArray.js
Created September 11, 2015 19:06
Convert string to hex char array
var s = '[';
'STRING_GOES_HERE'.split ('').map (function (c) { s += '0x'+c.charCodeAt (0).toString(16)+','; });
console.log(s+']');
@ireeymonse
ireeymonse / MuteRdioAds.js
Last active November 7, 2015 02:32 — forked from cayuu/MuteRdioAds.js
Mute Rdio Ads (copy + paste into browser console) [24 Oct 2013]
var r = R.player, oVol = r.volume(), tf = r._onTrackFinished, ar = r._onAudioReady, n = r._next;
r._onTrackFinished = function() {
R.logger.log("iree:trackFinished:"+arguments);
return .001 !== r.volume() && (oVol = r.volume()), r.volume(.001), tf.apply(this, arguments);
};
r._onAudioReady = function() {
R.logger.log("iree:audioReady:"+r.playingAd());
return r.playingAd() || r.volume(oVol), ar.apply(this, arguments);