This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 現在のユーザー名とホスト名をタイトルに | |
$global:currentuser = [System.Security.Principal.WindowsIdentity]::GetCurrent() | |
$user_and_host = ($currentuser.name -replace "(.*?)\\(.*?)$", "`$2@`$1") | |
$Host.UI.RawUI.WindowTitle = $user_and_host + " - Windows PowerShell" | |
# プロンプトのカスタマイズ | |
function prompt { | |
write-host "" | |
# ディレクトリの表示 (バックスラッシュをスラッシュに変換) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# show Git branch name with some informations | |
# normal: ~/git/foo (master) | |
# something to commit: ~/git/foo (master*) | |
# not pushed to origin: ~/git/foo (master!) | |
# something to commit and not pushed to origin: ~/git/foo (master*!) | |
# Git: get branch status | |
function git_get_branch_status { | |
local STATUS=`git status 2> /dev/null | tail -n1` | |
[[ ${STATUS} != "nothing to commit (working directory clean)" ]] && echo -ne "*" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function formatNameAndEmail(name, email) { | |
if (typeof name !== "string" || typeof email !== "string") { | |
throw "InputIsNotString"; | |
} else if (formatNameAndEmail.arguments.length > 2) { | |
throw "ArgumentsTooLong"; | |
} else { | |
return name + " <" + email + ">"; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@rem = '--*-Perl-*-- | |
@echo off | |
if "%OS%" == "Windows_NT" goto WinNT | |
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 | |
goto endofperl | |
:WinNT | |
perl -x -S %0 %* | |
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl | |
if %errorlevel% == 9009 echo You do not have Perl in your PATH. | |
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Kakaku.com specsearch permalink | |
// @namespace http://hail2u.net/ | |
// @description Insert a permalink to Kakaku.com specsearch result page. | |
// @include http://kakaku.com/specsearch/* | |
// ==/UserScript== | |
// console.time("insert-spec-search-permalink"); | |
var permalink = ""; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Gomidashi | |
// @namespace http://hail2u.net/ | |
// @description eco. | |
// @include http://mail.google.com/* | |
// @include https://mail.google.com/* | |
// ==/UserScript== | |
window.addEventListener('load', function () { | |
var garbageSchedule = [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nodes = document.querySelectorAll("*"), | |
l = nodes.length, | |
i, | |
matches = [], | |
j, | |
m, | |
color, | |
colors = {}, | |
doc = document, | |
styles = doc.styleSheets, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://developer.mozilla.org/ja/Core_JavaScript_1.5_Reference/Functions#.e5.86.8d.e5.b8.b0 | |
// ちょっと短く書きやすい | |
function walkTree (node) { | |
if (node === null) return; | |
// do something with "node" | |
Array.forEach(node.childNodes, walkTree); | |
} | |
walkTree(document); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @namespace http://hail2u.net/ | |
// @include http://b.hatena.ne.jp/entry/* | |
// @include http://b.hatena.ne.jp/entry?mode=more&url=* | |
// ==/UserScript== | |
Array.forEach(document.getElementsByClassName("plus_icon"), function (plus) { | |
plus.innerHTML = "はてなの奴隷だお^^"; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jquery.tablefilter.js - version 0.1.1 | |
* Insert a input form for filtering rows dinamically. | |
* | |
* Copyright (c) 2009 Kyo Nagashima <[email protected]> | |
* This library licensed under MIT license: | |
* http://opensource.org/licenses/mit-license.php | |
* | |
* Usage: | |
* Insert to all table |