Skip to content

Instantly share code, notes, and snippets.

View knu's full-sized avatar

Akinori Musha knu

  • Tokyo, Japan
  • 22:00 (UTC +09:00)
  • X @knu
View GitHub Profile
// ==UserScript==
// @name mltag
// @namespace http://jarp.does.notwork.org/userscripts
// @description Looks for things in the page that look like ML-tags but aren't hyperlinked, and converts them to clickable links.
// @include *
// ==/UserScript==
(function () {
const urlRegex = /\[(ruby[\w\-]+):0*(\d+)\]/ig;
class Enumerator
class Buffer
attr_accessor :status
def initialize(yielder, initial_status = nil)
@buffer = []
@yielder = yielder
@status = initial_status
end
module Enumerable
def with_yielder(&block)
Enumerator.new { |yielder|
each { |x|
block.call(x, yielder)
}
}
end
end
@knu
knu / gist:111055
Created May 13, 2009 14:38
How to mass-rename tags and push them with Git
# Rename tags named foo-bar-#.#.# to v#.#.# and push the tag changes
git tag -l | while read t; do n="v${t##*-}"; git tag $n $t; git push --tags ; git tag -d $t; git push origin :refs/tags/$t ; done
Index: lib/rubygems/doc_manager.rb
===================================================================
--- lib/rubygems/doc_manager.rb (revision 2210)
+++ lib/rubygems/doc_manager.rb (working copy)
@@ -98,6 +98,13 @@ class Gem::DocManager
end
##
+ # Is the RI documentation installed?
+
#!/usr/bin/env ruby
require 'rubygems'
require 'rubygems/doc_manager'
Gem.source_index.each { |name, spec|
next if !spec.has_rdoc
doc = Gem::DocManager.new(spec)
next if doc.rdoc_installed?
doc.generate_ri
Index: Completion/Unix/Command/_subversion
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v
retrieving revision 1.27
diff -u -r1.27 _subversion
--- Completion/Unix/Command/_subversion 22 May 2009 15:48:32 -0000 1.27
+++ Completion/Unix/Command/_subversion 31 May 2009 06:35:24 -0000
@@ -150,7 +150,7 @@
args=(
${=${${${(M)${(f)"$(LC_ALL=C _call_program options svnadmin help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}
diff --git a/PTYTextView.m b/PTYTextView.m
index eb83426..088439b 100755
--- a/PTYTextView.m
+++ b/PTYTextView.m
@@ -2626,32 +2626,90 @@ static float strokeWidth, boldStrokeWidth;
y: (int) y
{
static char *urlSet = ".?/:;%=&_-,+~#@!*'()";
- int x1=x, x2=x, y1=y, y2=y;
- int startx=-1, starty=-1, endx, endy;
#!/usr/bin/env ruby
File.open('.bzrignore') { |bzrignore|
bzrignore.each_line { |line|
case line
when /^\#/, /^\s*$/
next
else
line.strip!
dir, pattern = File.split(line)
diff --git a/libmemcached/memcached_io.c b/libmemcached/memcached_io.c
index 7bdb723..69b766e 100644
--- a/libmemcached/memcached_io.c
+++ b/libmemcached/memcached_io.c
@@ -105,28 +105,29 @@ memcached_return memcached_io_read(memcached_server_st *ptr,
while (1)
{
+ memcached_return rc;
+ if ((rc= io_wait(ptr, MEM_READ)) != MEMCACHED_SUCCESS)