Skip to content

Instantly share code, notes, and snippets.

View rosylilly's full-sized avatar
🕊️
Happy Hacking

Sho Kusano rosylilly

🕊️
Happy Hacking
View GitHub Profile
@rosylilly
rosylilly / lyric_manage.user.js
Created December 30, 2010 19:23
ニコニコ動画歌詞メンテ支援Greasemonkey
// ==UserScript==
// @name NicoLyricManager
// @namespace NicoLyricManager
// @description ニコ動の歌詞職人支援ツール
// @include http://www.nicovideo.jp/watch/*
// @include http://nine.nicovideo.jp/watch/*
// @excludes
// ==/UserScript==
(function(){
@rosylilly
rosylilly / fileWatch.rb
Created June 18, 2011 22:35
ファイルの更新を検知するFile.watchメソッドを生やす
require 'thread'
class File
# ファイルの更新を検知して、渡されたブロックを実行する
# 更新検知部分のコードは[ここ](http://ja.doukaku.org/comment/387/)のを丸パクリ
def self.watch(fileName, &function)
raise AugumentsError if(!File.exist?(fileName) || !function)
thread = Thread.new(fileName, function){ | _fileName, _function |
Thread.pass
last_mtime = File.mtime(_fileName)
@rosylilly
rosylilly / growlnotify.zshrc
Created August 19, 2011 08:49
Growl Notify for zsh
# 時間がかかったらgrowlで終了通知
local COMMAND=""
local COMMAND_TIME=""
precmd() {
if [ "$COMMAND_TIME" -ne "0" ] ; then
local d=`date +%s`
d=`expr $d - $COMMAND_TIME`
if [ "$d" -ge "30" ] ; then
COMMAND="$COMMAND "
echo -ne "\a"
@rosylilly
rosylilly / typeCheck.js
Created December 11, 2011 13:48
適当にJavascriptで型チェック
function TypeCheck(func) {
var argumentTypes = [];
var functionString = func.toString().replace(/\n/g, ' ');
var argumentString = functionString.replace(/^function.*?\(/, '').replace(/\).*$/,'');
var argumentTypes = argumentString.split(',');
for(var i=0,l=argumentTypes.length; i<l; i++) {
var match = argumentTypes[i].match(/\/\*\*(.*)\*\//);
if(match) {
argumentTypes[i] = match[1].replace(/^ *| *$/g,'').toLowerCase();
fs = require('fs')
fs.write('/dev/stdout', 'test!!', 'w')
phantom.exit()
@rosylilly
rosylilly / phantomjs-helloworld.coffee
Created March 24, 2012 16:45
phantomjsでハローワールド
fs = require('fs')
printfln = (text) =>
text += "\n"
fs.write('/dev/stdout', text, 'w')
printfln "Hello, World!"
phantom.exit()
@rosylilly
rosylilly / ZeroFix.user.js
Created May 2, 2012 09:42 — forked from miyukki/ZeroFix.user.js
ZeroFix is ZeroWatch of niconico fixer. ZeroWatchが改良するまでの暫定的なユーザースクリプトです。 タイトルの縮小、タグの複数段表示、市場エリアを投稿者情報に、コメント入力エリアを下に、フェードを無効化などの機能があります。
// ==UserScript==
// @name ZeroFix
// @namespace applest.net
// @version 0.5
// @description ZeroFix is ZeroWatch of niconico fixer. ZeroWatchが改良するまでの暫定的なユーザースクリプトです。 市場エリアに投稿者情報を表示、コメント投稿エリアの修正、フェード防止の機能があります。
// @include http://www.nicovideo.jp/watch/*
// ==/UserScript==
/****************************************
* 右上の[raw]をクリックしてダウンロード開始 *
@rosylilly
rosylilly / .gitignore
Created May 18, 2012 05:33
Bundlerでローカルだけで使うgemを書く
Gemfile.local
@rosylilly
rosylilly / gist:2730475
Created May 19, 2012 11:02
schemeでrgb->hex hex->rgb変換
(define-module color-convert
(export hex->rgb)
(export rgb->hex)
(export rgb->hls))
(select-module color-convert)
(use srfi-13)
(define (hex->rgb hex)
#!/usr/bin/env bash
exit 1