This file contains 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 FriendFeed quotation | |
// @namespace greasemonkey.akinori.org | |
// @description Make quotations visual on FriendFeed | |
// @include http://friendfeed.com/* | |
// ==/UserScript== | |
(function () { | |
var ffqNode = function (text) { | |
var span = document.createElement('span'); |
This file contains 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
require 'etc' | |
user = Etc.getpwnam("knu") | |
~user #=> "/home/knu" | |
Index: ext/etc/etc.c | |
=================================================================== | |
--- ext/etc/etc.c (revision 23702) | |
+++ ext/etc/etc.c (working copy) | |
@@ -603,6 +603,7 @@ Init_etc(void) |
This file contains 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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
# | |
# Requirements: | |
# - rubygems | |
# - nokogiri (gem install nokogiri) | |
# | |
# Example Usage: | |
# ./50oui2ki2 http://www.chunichi.co.jp/igo-shogi/50oui/text.html 50oui-1 |
This file contains 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
autoload -U zmv | |
ren () { | |
if [ $# -eq 1 ]; then | |
# Interactive edit | |
local newname="$1" | |
vared -c -p 'rename to: ' newname | |
command mv "$1" "$newname" | |
else | |
# Allow bare globbing | |
noglob zmv -W "$@" |
This file contains 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 FriendFeed Twitter linkification | |
// @namespace greasemonkey.akinori.org | |
// @description Linkify Twitter @name's in FriendFeed entries | |
// @include http://friendfeed.com/* | |
// ==/UserScript== | |
(function () { | |
var fftwlinkRun = function () { | |
var textNodes = document.evaluate( |
This file contains 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
# Put the following after defining PROMPT | |
if [ -n "$INSIDE_EMACS" ]; then | |
PROMPT="AnSiTu %n | |
AnSiTh %M | |
AnSiTc %d | |
$PROMPT" | |
fi | |
# Note the escape character right before each "AnSiT" |
This file contains 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
(eval-after-load "term" | |
'(progn | |
(setq term-prompt-regexp "^[^%]*%\\(\e\\[[0-9]*[A-Za-z]\\)* ") | |
(defun term-send-backspace () (interactive) (term-send-raw-string "\C-h")) | |
(define-key term-raw-escape-map "." 'term-line-mode) | |
(define-key term-mode-map "\C-c." 'term-char-mode))) | |
(autoload 'shell-toggle "shell-toggle" | |
"Toggles between the *shell* buffer and whatever buffer you are editing." | |
t) |
This file contains 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
#!/bin/sh | |
# | |
# editmsg - prompts user to input a message using an editor | |
# | |
# Copyright (c) 2007, 2008, 2009 Akinori MUSHA | |
# | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions |
This file contains 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
module Enumerable | |
def filter | |
Enumerator.new { |y| | |
begin | |
each { |x| | |
yield(x, y) | |
} | |
rescue LocalJumpError => e | |
end | |
} |
This file contains 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
module Enumerable | |
def filter(&block) | |
Enumerator.new { |y| | |
begin | |
each_with_object(y, &block) | |
rescue LocalJumpError => e | |
# handle break | |
raise unless /\Abreak from / === e.message | |
end | |
} |