Skip to content

Instantly share code, notes, and snippets.

BLOCKSIZE=100
rm x*.gz
bzcat source.txt.bz2 | split -l $BLOCKSIZE -d --filter='gzip --fast > ${FILE}.gz'
for f in x*.gz; do zcat $f | shuf | gzip --fast > shuf-$f; done
echo shuf-*.gz | gawk -v seed="${RANDOM}" 'BEGIN{srand(seed);} {while(NF) { i=int(rand()*NF)+1; cmd=sprintf("zcat %s", $i); if ((cmd | getline l) > 0) { print l; } else { $i=""; $0=$0; } } }' | gzip > shuf.gz
.stream-item {
margin-bottom: 0px !important;
}
.item-box {
padding: 2px !important;
border-bottom: 1px solid gray;
}
.tweet {
display: flex !important;
flex-direction: column !important;
@kikairoya
kikairoya / hjkl.user.js
Created January 13, 2017 10:59
jjjjjjjjjjjjjjjjjj
(function() {
function _onkeypress(key) {
switch (key.key) {
case "h":
case "H":
window.scrollBy(-100, 0);
return false;
case "j":
case "J":
window.scrollBy(0, 100);
@kikairoya
kikairoya / .emacs_ddskk
Last active October 16, 2015 07:44
ddskkの挙動が気に食わなかった
(when (require 'skk nil t)
(global-set-key (kbd "C-x j") 'skk-auto-fill-mode)
(global-set-key (kbd "C-x C-j") 'skk-auto-fill-mode)
(setq default-input-method "japanese-skk")
(setq skk-egg-like-newline t)
(defun u-skk-ctrlj-force-hiragana ()
(interactive)
(if (and (boundp 'isearch-mode)
isearch-mode)
nil
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.11 (GNU/Linux)
mQENBFVX6JsBCADNgqCiacKJqj9eoMNz55r3OzPlTMU7nwHdfrU+6Vq+iKhDMQwq
rEt77sUqJfzjAn6DzorzhoGPzBH4RJQlYnquWB7ZmO3HG9j+BgBSWGUYYZWcvyvQ
FlDlwk3bgh2mHyWKhuEgFfKXB2pLX1WYkNSJtKGCd3O4OwZJyfT2il78R+6Ffl6k
cvSK9Hkeupu3wuBau5tZC/B1ovMZXycXw2OYNoN9sdnkurQA49kHlq7aX88v0Ug+
cDj0h9wuvuwYSjkNRBdKzl/HVm6j87kOXhCTbb0wZ2+BOhXuD6CMpJ9UlTqUM56T
M+dLL818wcjzPJr+Y70GLHmxW/X51X4VnChlABEBAAG0NFRvbW9oaXJvIEthc2hp
d2FkYSAoa2lrYWlyb3lhKSA8a2lrYWlyb3lhQGdtYWlsLmNvbT6JATgEEwECACIF
// auto convert input and output encoding
// copyright (c) 2014 kikairoya <kikairoya@gmail.com>
// this file can use, redistribute and/or modify under
// Boost Software License 1.0 or GNU GPLv2
//
// usage:
// $ ${something outputs UTF-8,CP932,eucJP} | LANG=ja_JP.eucJP autoconv
// --> converts stdout encoding to eucJP
// $ LANG=ja_JP.UTF-8 autoconv ${something outputs UTF-8,CP932,eucJP}
// --> prints stdout and stderr encoding to UTF-8
/* modified levenshtein distance calculation
This program can be used, redistributed or modified under any of
Boost Software License 1.0, GPL v2 or GPL v3
copyright(c) 2014 kikairoya <kikairoya@gmail.com>
*/
#include <string.h>
@kikairoya
kikairoya / dropbox.service
Created August 17, 2014 11:18
~/.config/systemd/user/dropbox.service
[Unit]
Description=Dropbox as a systemd service
[Service]
Type=forking
ExecStart=/usr/bin/dropbox start
ExecStop=/usr/bin/dropbox stop
PIDFile=%h/.dropbox/dropbox.pid
[Install]
@kikairoya
kikairoya / netctl
Created August 17, 2014 11:00
fake netctl script for vmware-suspend
#!/bin/sh
case "$0" in
store)
;;
resume)
systemctl restart dhcpcd
;;
stop-all)
;;
%define gccver 4.8.2
Summary: rust for wandbox
Name: wandbox-rust-head
Version: %(eval date +%Y%m%d)
Release: 1
License: Apache
Group: wandbox
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: wandbox-gcc-%{gccver} wandbox-libuv
BuildRequires: libffi-dev