Skip to content

Instantly share code, notes, and snippets.

@kikairoya
kikairoya / geocities.jp
Created August 5, 2013 08:06
kill geocities' ad window
// ==UserScript==
// @name geocities
// @include http://www.geocities.jp/*
// ==/UserScript==
(function () {
document.addEventListener('DOMContentLoaded', function () {
var n = document.getElementById("y_gc_div_adcntr");
if (n) n.parentNode.removeChild(n);
}, false);
{
"network":{
"listen-port":2012,
},
"jail":{
"jail":"ptracer.exe",
"basedir":"/tmp/wandbox",
"max-address-space":1073741824,
"max-cpu-time":600,
"max-data-segment":134217728,
@kikairoya
kikairoya / tumblr.js
Created July 16, 2013 14:33
tumblr から引用元に直接飛ぶ
// ==UserScript==
// @name tumblr
// @include http://*.tumblr.com/post/*
// ==/UserScript==
(function () {
document.addEventListener('DOMContentLoaded', function () {
var n = document.getElementsByClassName("source_link")[0];
if (n) location.href = n.attributes["href"].nodeValue;
}, false);
@kikairoya
kikairoya / hatebu.js
Created July 14, 2013 06:52
skip hatebu comment page
// ==UserScript==
// @name hatebu
// @include http://b.hatena.ne.jp/entry/*
// ==/UserScript==
(function () {
document.addEventListener('DOMContentLoaded', function () {
var n = document.getElementById("head-entry-link");
if (n) location.href = n.attributes["href"].nodeValue;
}, false);
@kikairoya
kikairoya / _etc_profile.d_systemd.sh
Created June 24, 2013 14:01
Enables 'systemctl --user' without X11, dbus-launch, systemd-user-session
if [ ! -S /run/user/$(id -u)/dbus/user_bus_socket ]; then
mkdir -p /run/user/$(id -u)/dbus
dbus-daemon --session --fork --address=unix:path=/run/user/$(id -u)/dbus/user_bus_socket --systemd-activation
fi
if ! systemctl --user > /dev/null 2> /dev/null; then
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/dbus/user_bus_socket /usr/lib/systemd/systemd --user & > /dev/null 2> /dev/null
fi
#include <type_traits>
namespace detail {
template <typename T>
struct identity { typedef T type; };
template <typename T>
struct has_overloaded_address_operator_impl {
template <typename U>
static std::true_type check(U *p, identity<decltype(p->operator &())> * = 0);
template <typename U>
// ==UserScript==
// @name enforce japanese
// @include *
// ==/UserScript==
(function () {
var html = document.getElementsByTagName("html")[0];
if (!html) return;
if (!html.lang) {
var c = document.characterSet;
*.swp
*~
*.o
*.a
vendor_test
gtest
// ==UserScript==
// @include *****!!!!!! ここに gerrit の URI を入れる !!!!!!*****
// ==/UserScript==
// HookLib from http://ajalabox.blogspot.jp/2010/05/javascripthooklibjs.html
HookLib = {};
HookLib.chain = [];
HookLib.hook = function (funcname, hookfunc, options) {
var n = HookLib.chain.length;
PROMPT_COMMAND='
echo
echo -en "[\e[33m$(whoami)\e[0m@\e[35m$(hostname)\e[0m \e[31m$(date +%T)\e[0m] \e[32m$(pwd | sed s:$HOME:~:)\e[0m "
if git branch 2> /dev/null > /dev/null ; then
if git branch | grep -q "(no branch)" ; then
echo "(no branch)"
else
echo -ne [$(git branch | grep \* | sed "s/.*\* \\(\(.\+\)\\)/\1/")]
fi
echo -ne " "