Skip to content

Instantly share code, notes, and snippets.

@nullkal
nullkal / hybrid.minttyrc
Last active Apr 17, 2019
w0ng/vim-hybrid for mintty/wsltty
View hybrid.minttyrc
BoldAsFont=yes
Term=xterm-256color
BoldAsColour=yes
BackgroundColour=22,23,25
ForegroundColour=183,188,186
CursorColour=183,188,186
Black=42,46,51
BoldBlack=29,31,34
Red=184,77,81
BoldRed=141,46,50
View mstdn2birdsite.ts
/*
* mstdn2birdsite.ts - The filter code of "Mastodon → Twitter"
* Written in 2017 by nullkal <nullkal@nil.nu>
*
* To the extent possible under law, the author(s) have dedicated all copyright
* and related and neighboring rights to this software to the public domain
* worldwide. This software is distributed without any warranty.
* You should have received a copy of the CC0 Public Domain Dedication along
* with this software. If not, see
* <http://creativecommons.org/publicdomain/zero/1.0/>.
View keybase.md

Keybase proof

I hereby claim:

  • I am nullkal on github.
  • I am nullkal (https://keybase.io/nullkal) on keybase.
  • I have a public key ASDz0H8xzkQzZT_EtqFE3dENdOsM77nZAu0W99QnzjISeQo

To claim this, I am signing this object:

View mstdn2birdsite_wo_btnm.ts
/*
* mstdn2birdsite.ts - The filter code of "Mastodon → Twitter"
* Written in 2017 by nullkal <nullkal@nil.nu>
*
* To the extent possible under law, the author(s) have dedicated all copyright
* and related and neighboring rights to this software to the public domain
* worldwide. This software is distributed without any warranty.
* You should have received a copy of the CC0 Public Domain Dedication along
* with this software. If not, see
* <http://creativecommons.org/publicdomain/zero/1.0/>.
@nullkal
nullkal / aquaskk_iterm2.json
Last active May 24, 2018
AquaSKK + iTerm2環境でのCtrl-J問題を解決するためのKarabiner-ElementsのComplex Modificationsルール
View aquaskk_iterm2.json
{
"title": "AquaSKK",
"rules": [
{
"description": "Ctrl-J to Kana on Apple Terminal/iTerm2",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "j",
@nullkal
nullkal / decode.rb
Created Feb 4, 2015
BASE六十四卦
View decode.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require 'base64'
table = Hash[*"䷀䷪䷍䷡䷈䷄䷙䷊䷉䷹䷥䷵䷼䷻䷨䷒䷌䷰䷝䷶䷤䷾䷕䷣䷘䷐䷔䷲䷩䷂䷚䷗䷫䷛䷱䷟䷸䷯䷑䷭䷅䷮䷿䷧䷺䷜䷃䷆䷠䷞䷷䷽䷴䷦䷳䷎䷋䷬䷢䷏䷓䷇䷖䷁".split("").zip("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("")).flatten]
puts Base64.decode64((gets.split("").map {|c| table[c]}).join)
View colorgen.rb
#!/usr/bin/env ruby
# -*- encoding: utf-8 -*-
ColorNames = [
'aliceblue',
'antiquewhite',
'aqua',
'aquamarine',
'azure',
'beige',
@nullkal
nullkal / solve.cpp
Last active Dec 22, 2015
クロッシング問題の回答。計測位置間違えてそうなことに提出後に気づいた。 普通にマージソートで転倒数求めてます。Rubyでやったら配列の確保とかに時間かかってるっぽかったので、修正も面倒だしC++で書き直しました。途中までin-placeなマージソートの実装追い求めてましたが、色々頭が混乱してきたので最終的に至って普通のマージソートになりました。
View solve.cpp
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <chrono>
#include <cstdint>
std::vector<int> buf;
std::uintmax_t answer = 0;
@nullkal
nullkal / gist:6306428
Created Aug 22, 2013
FreeBSD向けのMinecraft(bukkit)鯖 起動スクリプト。 必要なもの: Java, tmux, 鯖を配置した各ディレクトリに一つstart.sh(bukkit Wikiに書いてあるLinux用craftbukkit.shそのままでOK)
View gist:6306428
#!/bin/sh
# PROVIDE: mc-servers
# REQUIRE: LOGIN
. /etc/rc.subr
name="mc_servers"
rcval=mc_servers_enable
@nullkal
nullkal / lifegame.scm
Created Sep 27, 2012
ライフゲーム
View lifegame.scm
(define (rot_l l)
(append (cdr l) (list (car l))))
(define (rot_r l)
(reverse (rot_l (reverse l))))
(define (forward_generation g)
(map (lambda (m n)
(map (lambda (m n)
(if (= n 1)