Skip to content

Instantly share code, notes, and snippets.

@syusui-s
syusui-s / bubble.c
Last active December 27, 2015 03:29
ソートとか。cntは比較回数。
// 普通のバブルソート
// 大小関係を比較し、スワップする。
#include <stdio.h>
#define LEN (6)
int swap(int *x, int *y){
int c;
c = *x;
*x = *y;
@syusui-s
syusui-s / md2pdf.sh
Created December 2, 2013 02:58
Markdown->LaTeX->DVI->PDFしてくれるMakefileを作成するスクリプト
#! /bin/bash
if [ "${1}" = "" ];then
echo "usage: ${0##*/} source"
exit 0
fi
if [ "$(echo ${1} | grep ".markdown$")" == "" ];then
echo "${0##*/}: error: unsupported filetype. source file should be markdown format."
exit 1
fi
@syusui-s
syusui-s / pixiv.js
Created December 19, 2013 03:20
艦これの検索に出てくる例のアレをごにょるやつ.
javascript:if(document.URL.match(/http:\/\/.*\.pixiv\.net\/img\d+\/img\/.*\//)!=null){document.location="http://www.pixiv.net/member_illust.php?mode=medium&illust_id="+document.URL.replace(RegExp.lastMatch,"").match(/\d+/)}
@syusui-s
syusui-s / mikutter.log
Last active October 22, 2016 11:11
セグフォしたmikutterのログ.何が原因なんや. Arch Linux x86_64, Ruby 2.0.0p353 (https://gist.github.com/syusui-s/8170638) [x86_64-linux], gem 2.0.14
There was an error while trying to write to Gemfile.lock. It is likely that
you need to allow write permissions for the file at path:
/opt/mikutter/Gemfile.lock
/opt/mikutter/core/mui/cairo_cell_renderer_message.rb: line 10
GLib-GObject-WARNING **:Attempt to add property GtkCellRendererMessage::message-id after class was initialised
error: /opt/mikutter/core/plugin/list/list.rb:275:in `rescue in block (3 levels) in <top (required)>': list redume failed
error: /opt/mikutter/core/plugin/list/list.rb:276:in `rescue in block (3 levels) in <top (required)>': undefined method `[]' for nil:NilClass
from /opt/mikutter/core/plugin/list/list.rb:269:in `block (3 levels) in <top (required)>'
from /opt/mikutter/core/plugin/list/list.rb:265:in `each'
from /opt/mikutter/core/plugin/list/list.rb:265:in `block (2 levels) in <top (required)>'
@syusui-s
syusui-s / .gitconfig
Last active January 3, 2016 02:39
git sandbox = サンドボックスへの切り替え,作成  git sandbox-reset = サンドボックスをdevelopブランチと同期させる
#######
# Git-sandbox
# create sandbox branch easily
#
# Please add below lines to your .gitconfig:
[alias]
sandbox = ! (git config sandbox.originBranch >> /dev/null || ! echo 'error: please set origin branch for sandbox\n (\"git config --local sandbox.originBranch <branchname>\")') && (git checkout sandbox || git checkout -b sandbox $(git config sandbox.originBranch))
sandbox-reset = ! git sandbox && git reset --hard $(git config sandbox.originBranch)
@syusui-s
syusui-s / git_prune_local.sh
Last active January 3, 2016 07:29
git_prune_local.sh
#!/bin/bash
# git prune-localとかいうの作りたかった
# 標準入力に,リポジトリのリストを渡すと消える
for branch in $(awk '{ print $3 }' < /dev/stdin | sed 's/^origin\///g');do git branch -D $branch;done
@syusui-s
syusui-s / kancollet_autoloader.user.js
Last active December 15, 2021 15:39
Kancollet Autoloader for Chrome and Firefox - Kancollet自動読み込み
// ==UserScript==
// @name Kancollet UserScript
// @version 0.12.5
// @author Shusui Moyatani
// @namespace https://gist.github.com/syusui-s/8703407
// @description Kancolletを自動起動する
// @icon http://syusui-s.github.io/kancollet/images/icon.png
// @match http://www.dmm.com/netgame/social/-/gadgets/=/app_id=854854*
// @match https://www.dmm.com/netgame/social/-/gadgets/=/app_id=854854*
// @updateURL https://gist.github.com/syusui-s/8703407/raw/kancollet_autoloader.user.js
@syusui-s
syusui-s / completion_parenthesis.vimrc
Last active August 29, 2015 13:56
show invisible letters
" 括弧補完
inoremap { {}<LEFT>
inoremap [ []<LEFT>
inoremap ( ()<LEFT>
inoremap " ""<LEFT>
inoremap ' ''<LEFT>
vnoremap { "zdi^V{<C-R>z}<ESC>
vnoremap [ "zdi^V[<C-R>z]<ESC>
vnoremap ( "zdi^V(<C-R>z)<ESC>
vnoremap " "zdi^V"<C-R>z^V"<ESC>
@syusui-s
syusui-s / google_imgtab_style.user.js
Last active August 29, 2015 13:56
動くかまだ試してない
// ==UserScript==
// @name Google Image Tab Before Style
// @namespace GoogleImgTabBeforeStyle
// @description Googleの画像タブの位置を以前の位置へ移動する
// @include /^https:\/\/.*google\..*\/.*&q=.*$/
// ==/UserScript==
function imgNode(nodes) {
for (var i = 0; i < nodes.length; ++i) {
if (nodes[i].innerText == '画像') return nodes[i];
@syusui-s
syusui-s / google_imgtab_style.js
Created February 20, 2014 08:05
とりあえず,前の位置には戻せる
javascript:function imgNode(nodes){ for(var i = 0; i < nodes.length; ++i){ if(nodes[i].innerText == '画像') return nodes[i]; } return false; } node = imgNode(document.getElementsByClassName('hdtb_mitem')); menu = document.getElementById('hdtb_msb'); menu.removeChild(node); menu.insertBefore(node, menu.childNodes[1]);