Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name mac_de_mona
// @namespace http://d.hatena.ne.jp/snaka72/
// @description Change font style to 'IPA mona font' for 2ch blog
// @include http://yaruomatome.blog10.fc2.com/*
// ==/UserScript==
(function () {
var s = document.createElement('style');
s.type = 'text/css';
s.innerHTML = "*{font-family:'IPA \u30E2\u30CA\u30FC P\u30B4\u30B7\u30C3\u30AF' !important;}";
/*
custom style for gist
div.section と組み合わせて適用範囲を限定することで、標準の.gist-xxxxの設定を上書きしている。
*/
div.section .gist .gist-file .gist-data pre{
-moz-border-radius-bottomleft: 0;
-moz-border-radius-bottomright: 0;
-webkit-border-bottom-left-radius: 0;
-webkit-border-bottom-right-radius: 0;
background: #000000 !important;
@snaka
snaka / gist:41255
Created December 29, 2008 12:44
Simple test utility for javascript
/**
* Simple JS test script
* @return
*/
function kickTest() {
testLog("This is tester JS");
new Test('TEST CASE 1', function(){
testLog("This is TEST CASE1");
}).run();
function offsetDate(offset, base) {
if(!base) base = new Date();
var result = new Date;
result.setTime(base.getTime() + (1000 * 60 * 60 * 24 * offset));
return result;
}
// ==UserScript==
// @name (hoge)
// @namespace http://d.hatena.ne.jp/snaka72/
// @description (description)
// @include http://*
// @include https://*
// @exclude (exclude)
// ==/UserScript==
//
// auther: snaka http://d.hatena.ne.jp/snaka72
/* appjet:version 0.1 */
// Vimperator document localization project
var projectUrl = "http://wiki.livedoor.jp/shin_yan/d/vimperator%202%2e0%20%a5%d8%a5%eb%a5%d7%cb%dd%cc%f5%a5%d7%a5%ed%a5%b8%a5%a7%a5%af%a5%c8?wiki_id=67820"
var wiki = wget(projectUrl);
function wash(str) {
if(!str) return '';
str = str.replace(/<[^>]+>/g, '');
str = str.replace(/%/g, '');
return str;
@snaka
snaka / ldr_gist_fullfeed.user.js
Created January 29, 2009 21:47
Fetch gist source then inject to ldr feeds. GistからコードをとってきてLDRでコードが読めるようにします。
// ==UserScript==
// @name ldr_gist_fullfeed
// @namespace http://d.hatena.ne.jp/snaka72/
// @include http://reader.livedoor.com/reader/
// ==/UserScript==
(function() {
var cache = {};
(unsafeWindow||window).entry_widgets.add("ldr_gist_fullfeed", function(feed, item) {
" ユーティリティコマンド
command -nargs=* feedkeys js events.feedkeys("<args>")
command -nargs=1 mac2clip js modules.util.copyToClipboard([i for each (i in events.getMacros("<args>"))][0][1])
" 今みているサイトをパラメタに入力したコメントをつけてポストする
command -nargs=* twit feedkeys :copy url<CR>:twitter <args> <C-v><C-v>
// ==UserScript==
// @name OndemandBackupHatenaDiary
// @namespace http://d.hatena.ne.jp/snaka72/
// @description Backup editing diary on demand in hatena diary.
// @include http://d.hatena.ne.jp/*/edit
// ==/UserScript==
// *** WARN: NOW ON PROGRESS!!!!!!!! ***
(function() {
const STORE_KEY="SAVED_DIARY_ENTRY";
var edit = document.getElementById('textarea-edit');
<html>
<head><title>Bookmarklet template</title></head> <body>
<ul> <li> <a href="javascript:(function(){
var%20sc=document.createElement('script');
sc.setAttribute('src','http://localhost:8080/test.js');
document.body.appendChild(sc);
})();
void(0);
">
Bookmark this!