Skip to content

Instantly share code, notes, and snippets.

@ykzts
ykzts / resize.sh
Last active August 29, 2015 14:19
for f in $(ls *.png); do test 1440 = $(sips -g pixelWidth ${f} | grep "pixelWidth:" | sed -e "s/^ *pixelWidth: *//") && sips -z 1080 1920 ${f} --out resize-${f} && mv resize-${f} ${f}; done
@todesking
todesking / bash.patch
Created September 25, 2014 15:03
This patch introduces very cool feature and no more vulnerability!!!
diff --git a/variables.c b/variables.c
index 92a5a10..b485dab 100644
--- a/variables.c
+++ b/variables.c
@@ -347,39 +347,6 @@ initialize_shell_variables (env, privmode)
temp_var = (SHELL_VAR *)NULL;
- /* If exported function, define it now. Don't import functions from
- the environment in privileged mode. */
anonymous
anonymous / gist:19bbb1eadf4f1c6bd761
Created June 26, 2014 07:52
pecoで履歴からマッチするキーワードをその場に補完
function in_place_history_keyword_completion() {
pos=CURSOR # 現在のカーソル位置を取得
selected=$(history -10000 | cut -d' ' -f3- | tr '|' ' ' | tr ' ' '\n' | sort -u | peco) # 選択した結果
BUFFER="${BUFFER[1,$pos]}${selected}${BUFFER[$pos,-1]}"
CURSOR=$#BUFFER # move cursor
zle -R -c # refresh
}
zle -N in_place_history_keyword_completion
bindkey '^R' in_place_history_keyword_completion
@mala
mala / limechat.css
Created February 4, 2014 07:02
limechatの画像展開機能でグロ画像や無修正画像などが表示されて困る人向けのテーマ
/* channel-nameには同僚の名前などが入ります */
body[channelname*="#channel-name"] .inlineimage { width: 30px !important; }
body[channelname*="#channel-name"] .inlineimage:hover { width: auto !important; }
use strict;
use warnings;
use feature 'say';
use JSON::PP qw(encode_json);
my $hash = {
num => 1
};
say encode_json($hash); # => {"num":1}
@ultraist
ultraist / jisure.txt
Created August 14, 2011 12:56
次スレデータ。2行1セット。奇数→偶数に流れた。
【WNI】The Last 10-Second 【緊急地震速報】
【WNI】The Last 10-Second 16【緊急地震速報】
Firefox userChrome.js greasemonkeyスクリプトスレ15
Firefox userChrome.js greasemonkeyスクリプトスレ16
Mozilla Firefox 非公式ビルド(MOD)スレッド10
Mozilla Firefox 非公式ビルド(MOD)スレッド11
Mozilla Firefox Part164
Mozilla Firefox Part165
IE×Firefox×Opera×Safari×Chrome最終戦争18回戦
IE×Firefox×Opera×Safari×Chrome最終戦争19回戦
@ucnv
ucnv / tweet-shindanmaker.js
Created May 22, 2011 10:32
phantomjs script to tweet through shindanmaker.com
var tweet;
var twitter_id = "";
var twitter_pw = "";
var phase;
var setState = function(nextPhase) {
var s = {tweet: tweet, twitter_id: twitter_id, twitter_pw: twitter_pw, phase: nextPhase};
phantom.state = JSON.stringify(s);
};
if(!phantom.state.length) {
var i, args = Array.prototype.slice.apply(phantom.args);