Skip to content

Instantly share code, notes, and snippets.

View hirakiuc's full-sized avatar
😵

hirakiuc hirakiuc

😵
  • japan
View GitHub Profile
@hirakiuc
hirakiuc / batty.json
Created October 29, 2022 12:50
The batty keyboard layout
[
{
"name": "batty",
"author": "hirakiuc",
"notes": "A split keyboard with 3x6 vertically staggered keys, 4 thumb keys, 2 keys for little fingers",
"switchMount": "cherry",
"plate": true,
"pcb": false
},
[
{
"title": "Escape from kana on vim",
"rules": [
{
"description": "Change input source to eisu with escape on vim",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "escape",
@hirakiuc
hirakiuc / fix.patch
Created January 20, 2019 14:06
fix reset key of qmk_firmware
diff --git a/tmk_core/common/avr/bootloader.c b/tmk_core/common/avr/bootloader.c
index c4b913280..bc9f545d4 100644
--- a/tmk_core/common/avr/bootloader.c
+++ b/tmk_core/common/avr/bootloader.c
@@ -70,7 +70,8 @@
* http://www.fourwalledcubicle.com/files/LUFA/Doc/120730/html/_page__software_bootloader_start.html
*/
#define BOOTLOADER_RESET_KEY 0xB007B007
-uint32_t reset_key __attribute__ ((section (".noinit")));
+//uint32_t reset_key __attribute__ ((section (".noinit")));
@hirakiuc
hirakiuc / my.cvimrc
Created March 20, 2018 13:22
my cvimrc
map <C-f> scrollFullPageDown
map <C-b> scrollFullPageUp
@hirakiuc
hirakiuc / jsonl.js
Created October 22, 2017 06:05
jsonl file loader
'use strict'
const fs = require('fs');
const path = require('path');
const zlib = require('zlib');
const gunzip = zlib.createGunzip();
const stream = require('stream');
const byline = require('byline');
const util = require('util');
@hirakiuc
hirakiuc / rds_info_dumper.rb
Last active May 15, 2018 06:47
dump rds list with vpc name.
require 'aws-sdk'
rds_client = Aws::RDS::Client.new
rds_resource = Aws::RDS::Resource.new(client: rds_client)
ec2_client = Aws::EC2::Client.new
ec2_resource = Aws::EC2::Resource.new(client: ec2_client)
def format_instance(rds, vpc_name)
[
@hirakiuc
hirakiuc / gulpfile.js
Created September 2, 2016 15:21
gulp-reduce-file example
const gulp = require('gulp');
const reduce = require('gulp-reduce-file');
const collect = (file, samples) => {
const api = JSON.parse(file.contents.toString('UTF-8'));
samples.push({
id: (file.relative).replace('.json', ''),
text: api.info.title
});
@hirakiuc
hirakiuc / iterator_enumerator.rb
Last active October 15, 2015 15:19
iterator, enumerator
class SimpleIterator
attr_accessor :step
def initialize
@values = (1..10).to_a
@pos = 0
@step = 0
end
def next
@hirakiuc
hirakiuc / gist:bcb7991ff3b01405f4f2
Last active August 16, 2017 08:58
StringIO with binary in ruby
require 'stringio'
# Create StringIO object from binary data file
StringIO.new(File.binread('pict.jpg'), 'rb')
# Create StringIO object from text data file
StringIO.new(File.read('memo.txt', encoding: Encoding::UTF_8), 'r')
@hirakiuc
hirakiuc / my_reverse.rb
Created April 26, 2013 11:23
self implementation Array.reverse to two functions.
# -*- coding: utf-8 -*-
require 'rubygems'
require 'rspec'
def swap(ary, n, m)
v = ary[n]
ary[n] = ary[m]
ary[m] = v
nil