Skip to content

Instantly share code, notes, and snippets.

@rubyu
rubyu / gist:1018000
Created June 9, 2011 23:37
minimize_TMP_multi_column_tab
#tabbrowser-tabs * {
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
line-height: 14px !important;
}
#tabbrowser-tabs .tabbrowser-tab,
#tabbrowser-tabs .tabbrowser-tab * {
max-height: 14px !important;
# -*- coding:utf-8 -*-
__author__="rubyu"
__date__ ="$2011/10/31 11:25:52$"
"""
This script provides Mock of TopologyBuilder which graphviz_format()
was implemented in.
A function graphviz_format() will output representation of builded
Topology in Dot Language.
@rubyu
rubyu / gist:3134735
Created July 18, 2012 07:11
bookmarklet: extract urls in the selected area
javascript:(function(){
var s = getSelection().getRangeAt(0).cloneContents();
var r = Array.prototype.slice.call(s.querySelectorAll('a')).map(function(a){ return '"' + a.href + '"'; });
var t = document.createElement('textarea');
t.value = r.join(',\n');
t.style.position = 'absolute';
t.style.width = '100%';
t.style.height = '100%';
t.style.border = 'none';
t.style.padding = '0';
@rubyu
rubyu / gist:3522270
Created August 30, 2012 04:16
app_restart.bat
@echo off
:: app_restart.bat
:: %1 path of application
tasklist | findstr %~nx1
if errorlevel 0 taskkill /f /im %~nx1
start "" %~f1
@rubyu
rubyu / disk.sh
Created October 11, 2012 10:55
disk benchmark
#!/bin/bash
for bench in \
"bonnie++ -d /raid -q -x 1 -s 32G -u root | grep '^[0-9]\+'" \
"dbench -D /raid 100 | grep '^Throughput' | sed -e 's/[^0-9]\+\([0-9.]\+\)[^0-9]\+\([0-9]\+\)[^0-9]\+\([0-9]\+\)[^0-9]\+\([0-9.]\+\).\+/\1,\2,\3,\4/'"
do
for sched in cfq deadline noop; do
for device in sda sdb sdc sdd sde sdf; do
echo $sched > /sys/block/${device}/queue/scheduler
done
@rubyu
rubyu / gist:3992720
Created November 1, 2012 09:32
SoftAltTab
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace SoftAltTab
Python path_to\fix_chainlp_epub.py "%1" "Fixed_%~nx1"
Python path_to\merge_chainlp_epub.py "%1" "Merged_%~nx1"
mkvmerge DTB-S1-D1.mkv -o DTB-S1-D1.mkv --split chapters:9,16,25,33
mkvmerge DTB-S1-D2.mkv -o DTB-S1-D2.mkv --split chapters:9,17,25,33
mkvmerge DTB-S1-D3.mkv -o DTB-S1-D3.mkv --split chapters:9,17,25
mkvmerge DTB-S1-D4.mkv -o DTB-S1-D4.mkv --split chapters:9,17,25
mkvmerge DTB-S1-D5.mkv -o DTB-S1-D5.mkv --split chapters:9,17,25
mkvmerge DTB-S1-D6.mkv -o DTB-S1-D6.mkv --split chapters:9,16,24
mkvmerge DTB-S2-D1.mkv -o DTB-S2-D1.mkv --split chapters:5,10,15,20,25
mkvmerge DTB-S2-D2.mkv -o DTB-S2-D2.mkv --split chapters:5,10,15,20,25
mkvmerge DTB-S2-D3.mkv -o DTB-S2-D3.mkv --split chapters:5,10,15
jpdfbookmarks_cli.exe gendai_eibunpou_kougi.pdf -a gendai_eibunpou_kougi.outline.txt -e UTF-8 -o gendai_eibunpou_kougi_outline.pdf