Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name DMMono
// @include chrome://browser/content/browser.xul
// @version 1.0.0
// @description Enable DMM mono access
// ==/UserScript==
var responseObserver = {
observe: function(subject, topic, data)
{
@fengmk2
fengmk2 / WeiboUtil.js
Created February 16, 2012 12:11
新浪微博mid与url互转实用工具
/**
* 新浪微博mid与url互转实用工具
* 作者: XiNGRZ (http://weibo.com/xingrz)
*/
var WeiboUtil = {
// 62进制字典
str62keys: [
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z",
@bgreenlee
bgreenlee / multipart_binary_posts.js
Created September 17, 2011 00:07
Multipart Binary POSTs in Javascript #javascript
var dataURL = this.canvas.toDataURL(this.getImageType()); // grab the snapshot as base64
var imgData = atob(dataURL.substring(13 + this.getImageType().length)); // convert to binary
var filenameTimestamp = (new Date().getTime());
var separator = "----------12345-multipart-boundary-" + filenameTimestamp;
// Javascript munges binary data when it undergoes string operations (such as concatenation), so we need
// to jump through a bunch of hoops with streams to make sure that doesn't happen
// create a string input stream with the form preamble