Skip to content

Instantly share code, notes, and snippets.

@permil
permil / karabiner.json (snippet)
Last active June 1, 2021 08:03
Capture screen by PrintScreen (on Mac with Karabiner)
{
"description": "Capture entire screen by PrintScreen",
"manipulators": [
{
"from": {
"key_code": "print_screen"
},
"to": [
{
"key_code": "3",
@permil
permil / config.h
Last active January 11, 2021 21:42
My Helix keymap
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
@permil
permil / config.h
Last active March 27, 2018 17:03
Let's Split keymap for JIS keyboard
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
@permil
permil / main.p6
Last active July 30, 2018 11:25
bf interpreter written in Perl 6
use v6;
class Brainfuck {
method run($prog) {
my @prog = $prog.comb(/./);
my $p_ptr = 0;
my @tape = ();
my $ptr = 0;
while @prog[$p_ptr] -> $char {
@permil
permil / dvorak_Left_JP.keymap
Created August 21, 2017 12:55
WeatherTyping用左手Dvorak配列
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<InputMethod Version="1">
<Version>1</Version>
<Name>Dvorak_Left_JP</Name>
<Author>August Dvorak</Author>
<Language>ja-JP</Language>
<Memo>左手用Dvorak配列</Memo>
<Weight Language="ja-JP">1.0</Weight>
<Signature>07B46AF590BDD9AD1A85660B5A2E8FEFDEB9D26E9DA0FF4C1E818CA34E7B1180BE42FC26213A0A92195BACA9F4EA95F6B5B46AF8BF4124914D2F8362D6CA9AA98F89A64F7B5A5A3D4CE120EE3A10BF619A07D27841238691D364CB363B7E07BF6444203E6A69CA5F9B3942EDDB311542F0943648F4FB415DBA67338FB5ADE6EA</Signature>
<KeyFilter>
p ; e
@ / * 1
; r ; m ;
0 $ l ;
i ; /
K(S(SI
(K(SS(SS(S(SSS)(SS(SS(SS)(SS(KI))))))(S(KS)K))))
(K(S(SI
(K(SS(S(SS(KI))(SS(SS(SS)(SS(KI)))))(S(KS)K))))
(K(S(SI
(K(SS(SS(SS(SS(S(SSS)(SS(SS(SS)(SS(KI))))))))(S(KS)K))))
(K(S(SI
(K(SS(S(SI(SS(SS(KI))))(SS(S(SSS))(SS(KI))))(S(KS)K))))
(K(S(SI
(K(S(SI(SS(SSI(SS(KI)))))(SS(S(SSS)(SSI(SS(KI)))))(S(KS)K))))
@permil
permil / life.rs
Last active February 6, 2018 15:22
Conway's Game of Life written in Rust
extern crate rand;
use std::thread;
use std::time::Duration;
use rand::Rng;
struct Field {
width: usize,
height: usize,
grids: Vec<Vec<bool>>
@permil
permil / main.lua
Last active February 6, 2018 15:21
bf interpreter written in Lua
prog = ">+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-]<.>+++++++++++[<+++++>-]<.>++++++++[<+++>-]<.+++.------.--------.[-]>++++++++[<++++>-]<+.[-]++++++++++."
p_ptr = 1
tape = {}
ptr = 0
insts = {
['>'] = function() ptr = ptr + 1 end,
['<'] = function() ptr = ptr - 1 end,
['+'] = function() if tape[ptr] == nil then tape[ptr] = 1 else tape[ptr] = tape[ptr] + 1 end end,
@permil
permil / main.rs
Last active February 6, 2018 15:20
bf interpreter written in Rust (https://github.com/rust-lang/rust)
fn main() {
let prog = ">+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++
++>-]<.>+++++++++++[<+++++>-]<.>++++++++[<+++>-]<.+++.------.--------.[-]>
++++++++[<++++>-]<+.[-]++++++++++.";
let mut inst = 0;
let mut tape = [0; 30000];
let mut ptr = 0;
while inst < prog.len() {