Skip to content

Instantly share code, notes, and snippets.

View hokaccha's full-sized avatar

Kazuhito Hokamura hokaccha

View GitHub Profile
@hokaccha
hokaccha / gist:58594
Created February 5, 2009 07:26
wordbreak.js for jQuery
$(function(){
var $targetElement = '.wordBreak';
if($.browser.msie) {
$($targetElement).css('word-break', 'break-all');
} else {
$($targetElement).each(function(){
if(navigator.userAgent.indexOf('Firefox/2') != -1) {
$(this).html($(this).text().split('').join('<wbr />'));
} else {
$(this).html($(this).text().split('').join(String.fromCharCode(8203)));
@hokaccha
hokaccha / gist:58601
Created February 5, 2009 07:38
gmailUnread user script
// ==UserScript==
// @name gmailUnread
// @namespace http://webtech-walker.com/
// @author hokaccha (Kazuhito Hokamura)
// @include http://mail.google.com/*
// @description add shortcut key is:unread search query
// ==/UserScript==
(function(){
document.addEventListener('keypress', function(e){
@hokaccha
hokaccha / gist:58602
Created February 5, 2009 07:40
hatebu2delicious.pl
#!/usr/bin/env perl
use strict;
use warnings;
use utf8;
use Net::Delicious;
# del.icio.us config
my $user = "username";
my $pass = "password";
@hokaccha
hokaccha / gist:58603
Created February 5, 2009 07:44
sfinit shell script
#!/bin/sh
pjName=$1
version=$2
if [ ! "$pjName" -o ! "$version" ]; then
echo 'usage: sfinit project_name version';
exit;
fi
if expr "$version" : "^1\.0" >/dev/null; then
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:strip-space elements="*"/>
<!--
DB Designer XML to Propel Schema XML
==== Author: Jonathan Graham <jkgraham@gmail.com>
==== Version: 0.5 (2008-01-25) (http://blog.tooleshed.com/?p=6)
(function() {
var today = new Date();
if (today.getDate() == 9 && today.getMonth() == 3) {
var head = document.getElementsByTagName('head')[0];
var style = document.getElementsByTagName('style');
for (var i = 0, len = style.length; i < len; i++) {
head.removeChild(style[0]);
}
var link = document.getElementsByTagName('link');
#!/usr/bin/env perl
use strict;
use warnings;
use LWP::Simple;
use JSON::XS;
my $file = shift;
my $json_text;
var Rollover = function(elem, suffix) {
// 初期化する
this.namespace = "Rollover"; // 名前空間
this.elem = elem; // ロールオーバーしたい要素
this.suffix = suffix || "_o"; // 接尾語
this.baseSrc = elem.getAttribute("src"); // 元画像のパス
this.overSrc = this.baseSrc.replace(/\.\w+$/, this.suffix + "$&"); // ロールオーバー後の画像
this.addEvent();
this.preLoad();
};
Class("Rollover", {
// プロパティの設定
has: {
namespace: {
is: "ro",
init: "Rollover"
},
elem: {
is: "rw"
},
if !has('ruby')
finish
endif
function! s:BlueCloth(line1, line2)
ruby << EOF
require 'rubygems'
require 'bluecloth'
firstline = VIM::evaluate('a:line1').to_i