Skip to content

Instantly share code, notes, and snippets.

View lo48576's full-sized avatar
✔️
activated

YOSHIOKA Takuma lo48576

✔️
activated
View GitHub Profile
@lo48576
lo48576 / README
Last active August 29, 2015 14:00
auto login scripts for TokyoTech Portal and titech-pubnet
titech-automatrix-bookmarklet.js : ブックマークレット用にちょっとだけ最適化したコード
titech-automatrix.user.js : FirefoxのGreasemonkey用ユーザスクリプト
使い方:
Greasemonkey用のは使える人はわかるだろうし省略。
お気に入りに登録して使うブックマークレット用のは、
javascript:(function(d,j,i,p,m){var l=d.login,f=d.getElementsByTagName('input'),t,c;switch(location.search.replace(/[&?]Template=([^&]*)(&.*)?/,'$1')){case "userpass_key":l.usr_name.value=i;l.usr_password.value=p;l.submit();break;case "idg_key":while(j++<3){t=f.item(j);c=t.parentNode.parentNode.getElementsByTagName('th')[0].innerHTML;t.value=m[c.match(/[1-7]/)[0].charCodeAt(0)-'1'.charCodeAt(0)].charAt(c.match(/[A-J]/)[0].charCodeAt(0)-'A'.charCodeAt(0));}l.submit();break;default:location.href='http://portal.titech.ac.jp/';}})(document,0,'14X99999','password1234',["1111111111","2222222222","3333333333","4444444444","5555555555","6666666666","7777777777"]);
@lo48576
lo48576 / README
Last active August 29, 2015 14:05
~/.vim/ 以下にnszk_splash.vimとnszk_splash.txtを配置。
.vimrcに(最終行あたりに)
runtime! nszk_splash.vim
の一行を追加。
vim-splashが必要です。NeoBundleとかで入れちゃってください。
NeoBundle 'thinca/vim-splash'
とかで。
FIXME:
@lo48576
lo48576 / queen1.c
Last active August 29, 2015 14:07
n_queen
#include <stdio.h>
#include <stdlib.h>
/*
* 1マスあたり1bitなテーブルで管理しているのでメモリ消費は
* 結構少ないと思われ。
*/
typedef unsigned long uint32;
@lo48576
lo48576 / main.c
Last active August 29, 2015 14:16
コメント参照。
/*!
* \file main.c
* \brief
* \date 2015/02/22
* C version: C99
*/
#ifdef __cplusplus
extern "C" {
#endif
@lo48576
lo48576 / convert.sh
Last active August 29, 2015 14:20
asciidoc to pdf (with fop)
#!/bin/sh
a2x -fpdf -dbook --fop --fop-opts="-c ./fop.xconf" --xsl-file=fop-vl-pgothic.xsl template.adoc
@lo48576
lo48576 / xmonad.hs
Created April 28, 2015 08:29
したろうさん用
--
-- xmonad example config file.
--
-- A template showing all available configuration hooks,
-- and how to override the defaults in your own xmonad.hs conf file.
--
-- Normally, you'd only override those defaults you care about.
--
import XMonad
@lo48576
lo48576 / date.vim
Last active September 26, 2015 14:39
" see http://linuxjm.osdn.jp/html/LDP_man-pages/man3/strftime.3.html
:nnoremap <F5> "=strftime("%Y/%m/%d %H:%M:%S")<CR>P
:inoremap <F5> <C-R>=strftime("%Y/%m/%d %H:%M:%S")<CR>
@lo48576
lo48576 / u_nyah_zsh.sh
Created May 31, 2012 11:40
zshに這いよる混沌
#!/bin/zsh
export u_nyah_count=${u_nyah_count:-"1"}
u_nyah_prompt()
{
pstr[1]='(」・ω・)」うー! '
pstr[2]='(/・ω・)/にゃー!'
pstr[3]='(」・ω・)」うー! '
pstr[4]='(/・ω・)/にゃー!'
@lo48576
lo48576 / sys_backup.sh
Last active October 7, 2015 12:17
動作中のLinuxシステムの/が含まれるパーティションのバックアップ。
#!/bin/bash
# 動作中のLinuxシステムの/が含まれるパーティションのバックアップ。/data1/はシステムとは別のパーティション(可能なら別の物理メディア)にあるべき。
mnt_root="/mnt/root"
hostname="`hostname`"
get_mnt_backup() {
echo "/data1/backup/${1}/root"
}
@lo48576
lo48576 / README
Created August 16, 2012 10:17
useful combinators (for infinite lists) and memos about Lazy K
These files are combinators (functions) with SKI combinator for infinite lists, descriptions which shows how to make them, and useful combinators.
Now there are only files about infinite combinators and related memos.
However, these memos will NOT be UPDATED (even if some data is wrong), so you should see new version ( http://gist.github.com/3888085 ) if you would like to use combinators written in these files.
ここには無限リスト(ストリームとも?)に関するコンビネータ、あるいはその作り方のメモ、それらの作業に便利な汎用的なコンビネータを置いてあります。
しかし有限リストを実装する方法を見つけたので、新しいgist ( http://gist.github.com/3888085 ) に移行します。
何故ここを残しておくかというと、無限リストと有限リストで名前が被るコンビネータが多いからです(mapとかfilterとか諸々)。
たとえこちらに間違いがあっても、もう基本的には修正しない(新しいものを追加する可能性はあるが)ので、基本的に新しいバージョンの方を参照してください。
あと、上の英語になんか変なのがあったら、誰か指摘してくれると嬉しいです。俺の母国語は日本語なんで…