Skip to content

Instantly share code, notes, and snippets.

View teramako's full-sized avatar

teramako teramako

View GitHub Profile
@teramako
teramako / df.cmd
Last active August 29, 2015 13:56
Windows でディスク使用率等の一覧を表示する
@if(0)==(0) ECHO OFF
CScript //NoLogo //E:JScript "%~f0" %*
GOTO :EOF
@end
var COLUMN_INFOs = {
k: {
drive: { width: 5, align: "left" },
type: { width: 4, align: "left" },
total: { width: 14, align: "right" },
@teramako
teramako / fix_mime_desc.patch
Created March 23, 2014 03:10
Mac の QuickTime プラグイン部分(about:addons と about:plugins)が文字化けしているので修正するパッチ
# HG changeset patch
# Parent 573ef29c7a9f67205f71527db56d7f32500feffc
diff -r 573ef29c7a9f toolkit/mozapps/extensions/internal/PluginProvider.jsm
--- a/toolkit/mozapps/extensions/internal/PluginProvider.jsm Sat Mar 22 08:07:42 2014 -0700
+++ b/toolkit/mozapps/extensions/internal/PluginProvider.jsm Sun Mar 23 09:19:00 2014 +0900
@@ -408,7 +408,7 @@
for (let i = 0; i < mimeTypes.length; i++) {
let type = {};
type.type = mimeTypes[i];
@teramako
teramako / list_found.js
Created January 19, 2015 13:10
Vimperator プラグイン。<Leader>/ でページ内検索した時にリストを作成して foundlist コマンドで該当箇所にジャンプする。
var wm = new WeakMap;
mappings.addUserMap([modes.NORMAL], ["<Leader>/"], "Search forward for a pattern", function () { openPrompt(modes.SEARCH_FORWARD); });
commands.addUserCommand(['foundlist', 'fl'], 'show found list',
function (args) {
var index = parseInt(args.literalArg, 10);
if (Number.isNaN(index))
return;
@teramako
teramako / gist:a076cedcaebcc70252bf
Last active August 29, 2015 14:17
今日ダウンロードしたzipファイル。
$ file HOGEHOGE.zip
HOGEHOGE.zip: Bourne-Again shell script text executable
$ strings HOGEHOGE.zip
#!/bin/bash
sed -e '1,/BIGIN HOGEHOGE/d' $0 |sed -e '1,/BIGIN HOGEHOGE/d' > ./test.tar.gz
tar zxvf test.tar.gz >/dev/null;
chown root aFile bFile cFile
chmod 4755 aFile bFile cFile
exit 0
#BIGIN HOGEHOGE
liberator.plugins.delicious = (function(){
function getBookmarkFile(){
let file = services.get("directory").get("ProfD",Ci.nsIFile)
file.append("ybookmarks.sqlite");
if (!file.exists() || !file.isReadable()){
return null;
}
manager.file = file;
return file;
/*
* http://www.bijint.com/
*
* == Start ==
* js plugins.bijin_clock.start(min)
* min: interval minutes (default: 1)
*
* == Stop ==
* js plugins.bijin_clock.stop()
*/
let PLUGIN_INFO =
<VimperatorPlugin>
<name>{NAME}</name>
<description>like Growl (xul version)</description>
<require type="plugin">notifier.js</require>
<version>0.1</version>
<minVersion>2.0pre</minVersion>
<maxVersion>2.0</maxVersion>
<detail><![CDATA[
popup alert like Growl
liberator.plugins.reorgSQLite = (function(){
const obs = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
const ss = Cc["@mozilla.org/storage/service;1"].getService(Ci.mozIStorageService);
let sqliteFiles = [];
function getSQLiteFiles(){
if (sqliteFiles.length > 0){
return sqliteFiles;
jetpack.future.import("slideBar");
const NAME = "wikipedia-ja", baseURL = "http://en.m.wikipedia.org";
function getSlidebar(){
return jetpack.tabs.focused.raw.ownerDocument.defaultView.slideBar;
}
function getSlideFeature(slidebar){
return slidebar.features.filter(function(F) "name" in F.args && F.args.name == NAME)[0];
}
let PLUGIN_INFO =
<VimperatorPlugin>
<name>{NAME}</name>
<description>get expanded or shorten URL with bit.ly</description>
<author mail="teramako@gmail.com" homepage="http://d.hatena.ne.jp/teramako/">teramako</author>
<version>0.6.3</version>
<minVersion>2.0</minVersion>
<maxVersion>2.2a1pre</maxVersion>
<detail lang="ja"><![CDATA[
http://bit.ly/ のAPIを使用して短いURLを得たり、元のURLを得るためのコード