Skip to content

Instantly share code, notes, and snippets.

@msmhrt
msmhrt / b4
Created April 2, 2011 20:07
Better BlackBird Bookmarklet
javascript:(function(){_my_script=document.createElement('SCRIPT');_my_script.type='text/javascript';_my_script.src='https://github.com/msmhrt/b4/raw/master/bookmarklet.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_my_script);})();
@msmhrt
msmhrt / b4kml
Created April 6, 2011 04:34
Better BlackBird Bookmarklet for Google Maps
javascript:(function(){_my_script=document.createElement('SCRIPT');_my_script.type='text/javascript';_my_script.src='https://github.com/msmhrt/b4/raw/b4kml/bookmarklet.js?x='+(Math.random());document.getElementsByTagName('head')[0].appendChild(_my_script);})();
@msmhrt
msmhrt / gist:922908
Created April 16, 2011 05:51
teritori for Tweets
javascript:(function(){if(!window.teritori){teritori={};}teritori.cfg='mode:tweet';teritori.s=document.createElement('script');teritori.s.type='text/javascript';teritori.s.charset='utf-8';teritori.s.src='https://raw.github.com/msmhrt/teritori/master/teritori.js?key='+(Math.random());document.getElementsByTagName('head')[0].appendChild(teritori.s);}());
@msmhrt
msmhrt / gist:922909
Created April 16, 2011 05:52
teritori for Twitter User Profiles
javascript:(function(){if(!window.teritori){teritori={};}teritori.cfg='mode:profile';teritori.s=document.createElement('script');teritori.s.type='text/javascript';teritori.s.charset='utf-8';teritori.s.src='https://raw.github.com/msmhrt/teritori/master/teritori.js?key='+(Math.random());document.getElementsByTagName('head')[0].appendChild(teritori.s);}());
@msmhrt
msmhrt / gist:922910
Created April 16, 2011 05:53
teritori for Placemark's description of Google Maps
javascript:(function(){if(!window.teritori){teritori={};}teritori.cfg='mode:tweet4kml';teritori.s=document.createElement('script');teritori.s.type='text/javascript';teritori.s.charset='utf-8';teritori.s.src='https://raw.github.com/msmhrt/teritori/master/teritori.js?key='+(Math.random());document.getElementsByTagName('head')[0].appendChild(teritori.s);}());
@msmhrt
msmhrt / client_handler.js
Created October 7, 2011 19:20
An example of ClientHandler of Google Apps Script Gadget
/*global UiApp:false, Utilities:false */
function apply_style(widget, styles) {
'use strict';
var key;
for (key in styles) {
if (styles.hasOwnProperty(key)) {
widget.setStyleAttribute(key, styles[key]);
@msmhrt
msmhrt / ttfixer.user.js
Created December 4, 2011 13:21
twttr.tco fixer
// ==UserScript==
// @name twttr.tco fixer
// @namespace https://gist.github.com/1430180
// @description This is just a script for quick and dirty hack to fix the problem caused by twttr.tco.updateSelection() on Twitter
// @include https://twitter.com/*
// @include http://twitter.com/*
// @author Masami HIRATA
// @version 0.1
// ==/UserScript==
(function (i) {
'use strict';
var foo;
switch (i) {
case 1:
foo = 'bar';
break;
}
return foo;
}());
@msmhrt
msmhrt / testham.py
Created March 25, 2012 04:12
side_effect = lambda *args: call(*args)
#!/usr/bin/env python3.2
import unittest
from mock import call, patch
class Spam:
def __init__(self, *args):
pass
RE_PERLQQ_META = re.compile(r'''(?x)
\\(?: (?P<special>[nrt\\@$])
| (?P<octal>[0-3][0-7][0-7]|[0-7][0-7]|[0-7])
| x(?: (?P<hex>[0-9a-fA-F]{2})
| \{(?P<bracketed_hex>[0-9a-fA-F]{2,4})\}
)
| N\{(?: U\+(?P<unicode>[0-9a-fA-F]{4})
| (?P<unicode_name>[-A-Z0-9 ]*)
)\}
)