Skip to content

Instantly share code, notes, and snippets.

Avatar

Kazuhito Hokamura hokaccha

View GitHub Profile
@hokaccha
hokaccha / gist:58594
Created Feb 5, 2009
wordbreak.js for jQuery
View gist:58594
$(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 Feb 5, 2009
gmailUnread user script
View gist:58601
// ==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 Feb 5, 2009
hatebu2delicious.pl
View gist:58602
#!/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 Feb 5, 2009
sfinit shell script
View gist:58603
#!/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
View dbd2propel.xsl
<?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)
View remember_naked.js
(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');
View jsonview.pl
#!/usr/bin/env perl
use strict;
use warnings;
use LWP::Simple;
use JSON::XS;
my $file = shift;
my $json_text;
View rollover.js
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();
};
View joose_rollover.js
Class("Rollover", {
// プロパティの設定
has: {
namespace: {
is: "ro",
init: "Rollover"
},
elem: {
is: "rw"
},
View bluecloth.vim
if !has('ruby')
finish
endif
function! s:BlueCloth(line1, line2)
ruby << EOF
require 'rubygems'
require 'bluecloth'
firstline = VIM::evaluate('a:line1').to_i
You can’t perform that action at this time.