Skip to content

Instantly share code, notes, and snippets.

View gist:4008
// ==UserScript==
// @name Kill hotkeys on Mediawiki
// @namespace miyagawa
// @description Unbinds Mediawiki hotkeys that conflicts with Emacs key-binding on Safari
// @creator Tatsuhiko Miyagawa
// @include https://example.com/wiki/*
// ==/UserScript==
window.addEventListener("load", function(e) {
for (var id in window.ta) {
View gist:4943
javascript:if(/\/watch\/\w+/.test(document.URL)){location.href='http://nicozon.blog64.fc2.com/?video_id='+/\/watch\/(\w+)/.exec(document.URL)[1];}else{alert('Not%20NicoNico%20Douga');}undefined;
View gist:6062
Index: t/simple.t
===================================================================
--- t/simple.t (revision 71)
+++ t/simple.t (working copy)
@@ -4,10 +4,12 @@
use CGI;
use IO::Capture::Stdout;
use Test::More;
-eval 'use CPAN::Mini::Webserver;
-my $server = CPAN::Mini::Webserver->new();
View svn-log-github.pl
#!/usr/bin/perl
# http://www.simplisticcomplexity.com/2008/03/05/cleanly-migrate-your-subversion-repository-to-a-git-repository/
use strict;
use warnings;
use Web::Scraper;
use URI::Escape;
use URI;
$| = 1;
my %authors;
View remedie-mover.pl
#!/usr/bin/perl
use strict;
use warnings;
use File::Basename qw(basename);
my($key, @files) = @ARGV;
for my $f (@files) {
my $domain = domain_for($f) || "default";
$domain = "default" if $domain eq '*';
View github-importer
#!/bin/sh
PROJ=$1
SVNURL=$2
AUTHORS=$HOME/.github.authors
mkdir $PROJ.tmp
cd $PROJ.tmp
git-svn init $SVNURL --no-metadata
git config svn.authorsfile $AUTHORS
git-svn fetch
View outerhtml.js
jQuery.fn.outerhtml = function() {
return $("<div/>").append(this).html();
};
View Modern-Perl-errata
P.14
- $self->SUPER($client, $request)
+ $self->SUPER::write_response($client, $request)
P.26 図1.3
- Mamma
+ Mammal
View gitpan.pl
#!/usr/bin/perl
use strict;
use warnings;
use DirHandle;
use JSON::XS;
use LWP::UserAgent;
use Carp;
use CPAN::Inject;
use CPAN ();
use URI;
View Setting up new Mac.txt
This is a MacBook Pro with Leopard 10.5.6, already setup by Six Apart IT.
Install Dropbox
Sync Dropbox
Install 1Password
Import 1password.agilekeychain (in Dropbox)
System Preferences -> International -> Language Input Menu
Add Japanese and assign Ctrl-O