Skip to content

Instantly share code, notes, and snippets.

@tomykaira
tomykaira / sky_keymap.c
Created December 8, 2018 14:33
for SKY, helix based
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
#define BASE 0
#define META 1
#define SYMB 2
#define SKY 3
// Fillers to make layering more clear
sudo docker run --privileged -it petalinux /bin/bash
1 sudo apt-get update
2 apt-get update
3 apt-get install build-essential binutils ncurses-dev u-boot-tools file
4 $ sudo apt-get install tofrodos iproute2 gawk net-tools libncurses5-dev tftp tftpd-hpa zlib1g-dev libssl-dev flex bison libselin
5 $ sudo apt-get install diffstat xvfb chrpath xterm libtool socat autoconf unzip texinfo gcc-multilib libsdl1.2-dev libglib2.0-dev zlib1g:i386
6 apt-get install diffstat xvfb chrpath xterm libtool socat autoconf unzip texinfo gcc-multilib libsdl1.2-dev libglib2.0-dev zlib1g
7 ll
@tomykaira
tomykaira / keymap.c
Created June 24, 2018 03:07
foobar one handed key map for twittering on iPhone.
#include QMK_KEYBOARD_H
#define _QWERTY 0
#define _PN 1
extern keymap_config_t keymap_config;
// tap dance
enum {
KC_KG = 0,
@tomykaira
tomykaira / keymap.c
Created June 23, 2018 18:52
Alternative of let's split keymap, for foobar keyboard. Use with QMK. MIT License.
// Copyright Megumi Tomita <tomykaira@gmail.com>.
// MIT License.
#include QMK_KEYBOARD_H
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
FROM fluent/fluentd
RUN apk add --update --virtual .build-deps \
sudo build-base ruby-dev \
&& sudo gem install --no-document \
"fluent-plugin-gcs:0.4.0.beta1" \
fluent-plugin-cloudwatch-put \
fluent-plugin-slack \
&& sudo gem sources --clear-all \
&& apk del .build-deps \
@tomykaira
tomykaira / java2smali.sh
Created September 9, 2017 17:52
Java to smali conversion, one liner.
#!/bin/sh
set -e
JAVA_HOME='/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home'
cd /tmp
cat > input_tmp.java <<EOF
public class input_tmp {
public static void main(String[] args) {
user target_user
1 2
1 4
1 8
2 1
3 2
4 1
4 5
5 4
5 6
@tomykaira
tomykaira / fork_safe.rb
Created July 15, 2016 08:31
Fork safe connection pool in Ruby. Not elegant.
require 'connection_pool'
def open_pool
pool = ConnectionPool.new { File.open('/dev/null', 'r') }
class << pool
def fileno
with { |fd| fd.fileno }
end
end
pool
@tomykaira
tomykaira / Setup.sh
Created July 14, 2016 03:19
How to use webpay node module from typescript.
npm install -g typescript
mkdir test
npm install webpay
tsc test.ts
node test.js
@tomykaira
tomykaira / Base64.h
Last active March 30, 2024 11:04
C++ single header base64 decode/encoder for C++ 11 and above.
#ifndef _MACARON_BASE64_H_
#define _MACARON_BASE64_H_
/**
* The MIT License (MIT)
* Copyright (c) 2016-2024 tomykaira
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including