Skip to content

Instantly share code, notes, and snippets.

@oflow
oflow / twitter-new-sushi.css
Created June 16, 2017 04:21
新しい🍣 それはエモーショナルに回転する
/* 回転🍣
*
* https://twitter.com/oflow/status/875568672021987329
*
*/
.HeartAnimation:before {
content: '🍣' !important;
display: inline-block !important;
}
.favorited .HeartAnimation:before {
@oflow
oflow / tmux-2.5-fix.patch
Created June 6, 2017 06:39
tmux-2.5でEast Asian Ambiguous Characterを全角文字の幅で表示するやつと半角ボーダーをまとめたやつ
diff -uprN tmux-2.5/options-table.c tmux-2.5-patched/options-table.c
--- tmux-2.5/options-table.c 2017-05-29 16:08:04.000000000 +0900
+++ tmux-2.5-patched/options-table.c 2017-06-06 13:30:20.390849587 +0900
@@ -129,6 +129,14 @@ const struct options_table_entry options
.separator = ","
},
+#ifndef NO_USE_UTF8CJK
+ { .name = "utf8-cjk",
+ .type = OPTIONS_TABLE_FLAG,
@oflow
oflow / msys-zsh.md
Last active November 7, 2017 14:18
そんなことかよ!

MSYS2のzsh-5.2以降でUnicode絵文字が化けていたのはzsh-5.1.1-1に戻すと直る。

pacman -U /var/cache/pacman/pkg/zsh-5.1.1-1-x86_64.pkg.tar.xz
lazy-load使うならJavaScript無効の時に表示されるようにnoscriptタグも使えボケ
お前のサイトのスクリプトなんか許可したくねーんだよ!
<img class="lazy" data-src="元画像">
<noscript>
<img src="元画像">
</noscript>
@oflow
oflow / window_update_toggle.vbs
Created May 9, 2017 14:09
俺のタイミングで更新させろ!それ以外は何もするな!何もするな!!
Option Explicit
Dim wsh, svList, svInfo
Dim scPath, query, scMode
scPath = "%WINDIR%\System32\sc.exe"
query = "SELECT * FROM Win32_Service WHERE Name='wuauserv'"
Set svList = GetObject("winmgmts:").ExecQuery(query)
For Each svInfo In svList
scMode = svInfo.StartMode
@oflow
oflow / egid.js
Last active May 5, 2017 11:59
egid
'use strict';
var client = require('cheerio-httpcli'),
fs = require('fs'),
co = require('co'),
ev = '',
act = 3;
client.setBrowser('chrome');
@oflow
oflow / _zopfli.zsh
Created February 15, 2017 06:33
雑なzopfli補完
compdef _zopfli zopfli
function _zopfli() {
_arguments \
'-h[help]' \
'-c[write the result on standard output]' \
'-v[verbose mode]' \
'--i#[perform # iterations (default 15). Expamples --i50]' \
'--gzip[output to gzip format (default)]' \
'--zlib[output to zlib format]' \
'--deflate[output to deflate format]' \
@oflow
oflow / .zshrc
Created January 24, 2017 03:46
tmuxでdetachしたやつが1つだけあった場合は自動でattachする。それ以外はlist-sessionsで一覧表示
if [ -z $TMUX ] && [ `tmux list-sessions | grep -v 'attached' | wc -l` -eq 1 ]; then
tmux attach -t `tmux list-sessions | grep -v 'attached' | awk -F: '{print $1}'`
else
w
if [ -z $TMUX ]; then
echo -e "\ntmux sessions"
tmux list-sessions
fi
fi
@oflow
oflow / smartctl_short.sh
Created December 29, 2016 00:40
one-line display `smartctl -H /dev/sdX` and `smartctl -A /dev/sdX`
#!/bin/sh
# 1 (01) Raw_Read_Error_Rate
# 5 (05) Reallocated_Sector_Count
# 10 (0A) Spin_Retry_Count
# 196 (C4) Reallocated_Event_Count
# 199 (C7) UDMA_CRC_Error_Count
devices=("sda" "sdb")
for dev in "${devices[@]}"; do
@oflow
oflow / display_resolution_toggle.vbs
Last active December 27, 2016 07:37
change display resolution & refresh rate toggle script
Option Explicit
Dim wsh, ret, vc, lnk
Dim width, height, dcNum
Dim dcPath, dcOpt, lnkPath, lnkDesc, icoPath, id
' dccmd.exe : http://12noon.com/?page_id=80
' dccmd.exe -listmonitors
' change monitor 1 (= \\.\DISPLAY1, = VideoController1)
dcPath = "D:\apps\dc64cmd.exe"