Skip to content

Instantly share code, notes, and snippets.

@amashigeseiji
amashigeseiji / ff.zsh
Created September 18, 2013 01:54
シェルでブックマーク管理する用のスクリプト $ bmark <tagname> <url> でブックマーク登録, $ ff -b <tagname> でブックマークを開く タグ名で補完します
#!/bin/zsh
ff(){ #{{{
local bmark=$HOME/.zsh/bmark
local url str prefix arg
prefix='http://'
if [ $# -gt 0 ];then
while getopts ':b:' opt
do
case $opt in
b) arg=$OPTARG;;
@amashigeseiji
amashigeseiji / op_install
Last active December 22, 2015 08:29
OpenPNEインストール用シェルスクリプト
#!/bin/sh
# base parameter{{{
conf_file=$HOME'/.opconf';
basedir=
command=
target_dir=
dir=
option=
branch=
#}}}
#http://critical-theory.com/letter-young-giorgio-agamben-hannah-arendt/
Dear Mrs. Arendt,
I had your address from Dominique Fourcade, with
whom I had the pleasure of attending the seminars
of Heidegger in Provance in the Summers of 1966
and 1968.
I am a young writer and essayst for whom
discovering your books last year has represented
perience.
function testfunc(){
local num=0
local property pre_func_def pre_count new_func_def
pre_func_def=$(which testfunc)
pre_count=$(echo $pre_func_def|awk 'NR==2 {print $2}')
property=$(echo $pre_func_def|awk 'NR==2 {print $2}'|awk -F'=' '{print $1}')
new_count=${property}'='$(expr $num + 1)
new_func_def=$(echo $pre_func_def|sed -e "s/local $pre_count/local $new_count/")
eval $new_func_def
echo $num
commands.addUserCommand(
["gmail"],
"gmail account switcher",
function(arg)
{
if (arg == 'other') arg = '1';
else arg = '0';
let url = 'http://mail.google.com/mail/u/';
liberator.open(url + arg);
},
@amashigeseiji
amashigeseiji / redmine.js
Last active December 16, 2015 00:09
vimp用 autocmd DOMLoad 'urlを指定' source redmine.js とか設定ファイルにかいて読ませる
//"redmineのattributes内のurlをリンクにする
(function(){
var attributes = window.content.document.getElementsByClassName('attributes');
var arr = attributes[0].childNodes[1].getElementsByTagName("td");
for (i=0;i<arr.length;i++)
{
if( arr[i].innerHTML.match(/^http.*/) ){
if(arr[i].innerHTML.match(/<a.*/)){ return; }
else{ arr[i].innerHTML = '<a href="' + arr[i].innerHTML + '">' + arr[i].innerHTML + '</a>'; return;}
}
<?php
class Single
{
private static $instance;
private function __construct()
{
self::tetete();
}
= domain
[2013-03-24 13:06]
■domain
【名】
1. 〔統治{とうち}している〕領地{りょうち}、領土{りょうど}、藩{はん}
2. 〔活動{かつどう}や影響{えいきょう}の〕領域{りょういき}、分野{ぶんや}
・Agriculture was in my particular domain. : 特に農業が専門でした。
3. 〔個人{こじん}や企業{きぎょう}の〕所有地{しょゆうち}
4. 《法律》〔所有者{しょゆうしゃ}の土地{とち}の〕占有(権){せんゆう(けん)}◆【同】demesne
@amashigeseiji
amashigeseiji / vim-keybind_on_google-spreadsheet
Last active May 11, 2021 08:08
googlespreadsheetをvimキーバインドで操作したかったので設定してみた(要feedSomeKey_3.js) ※以下の設定をvimperatorrcにコピーすればhjklでの移動、insert-mode/normal-modeの切り替えとか出来ます
command! -nargs=+ lazy autocmd VimperatorEnter .* <args>
"googlespreadshet{{{
autocmd LocationChange '((drive|docs)\.google\.com).*(/spreadsheet/).*[0-9]+$' <C-j>
"insert-modeでの<esc>キーはspreadsheetでのエスケープキーにする(insert-modeは抜けない)
lazy fmaps -u='((drive|docs)\.google\.com).*(/spreadsheet/).*[0-9]+$' -modes=i <esc>
"insert-mode/normal-modeの切り替え(iでinsert-mode/<C-j>でnormal-mode)
inoremap -u='((drive|docs)\.google\.com).*(/spreadsheet/).*[0-9]+$' <C-j> <esc>