Skip to content

Instantly share code, notes, and snippets.

@ryonakae
ryonakae / 2019100601.json
Last active October 6, 2019 15:22
My Rules of Karabiner-Elements Complex Modifications
{
"title": "My Rules",
"rules": [
{
"description": "Change grave to esc / fn+grave to backslash / backslash to grave",
"manipulators": [
{ "_comment": "graveをescにする" },
{
"type": "basic",
"from": {
@ryonakae
ryonakae / chromaticAberrationFilter.frag
Created June 20, 2019 09:37
PixiJS chromatic aberration filter
precision mediump float;
varying vec2 vTextureCoord;
uniform sampler2D uSampler;
uniform vec2 uResolution; // app.screen
uniform vec2 uMouse; // -1.0 ~ 1.0
uniform vec2 uRed;
uniform vec2 uGreen;
uniform vec2 uBlue;
@ryonakae
ryonakae / config.h
Created March 17, 2019 13:10
ErgoDash mini Keymap
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <[email protected]>
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.
@ryonakae
ryonakae / gid_to_wid.js
Last active December 3, 2018 05:01
node.jsでスプレッドシートのgidをworksheetidに変換
function gid_to_wid(gid) {
const xorval = gid > 31578 ? 474 : 31578
const letter = gid > 31578 ? 'o' : ''
const wid = letter + parseInt((gid ^ xorval)).toString(36)
console.log('gid', gid)
console.log('xorval', xorval)
console.log('letter', letter)
console.log('worksheetid', wid)
}
@ryonakae
ryonakae / QRCode.js
Last active September 9, 2019 16:46
QRious & PixiJS Example
import * as PIXI from 'pixi.js'
import QRious from 'qrious'
export default class QRCode {
constructor() {}
// URLからQRコードを生成
generateQrCode(url) {
return new Promise((resolve) => {
const qrCode = new QRious({
@ryonakae
ryonakae / index.html
Last active August 24, 2018 04:30
Intersection Observer Example
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<script src="dist/main.js"></script>
<style>
.target {
width: 200px;
height: 500px;
margin: 1000px 0;
@ryonakae
ryonakae / docker-compose.yml
Last active August 16, 2018 06:28
WordPress + MySQLの最小構成
version: '3'
services:
wordpress:
image: wordpress:latest
ports:
- 9000:80
environment:
WORDPRESS_DB_PASSWORD: hoge
depends_on:
@ryonakae
ryonakae / spotlight-eisu.json
Created April 9, 2018 04:47
Spotlight起動時にIMEを英数にするKarabiner-ElementsのComplex Modifications
{
"title": "Spotlight起動時にIMEを英数にする",
"rules": [
{
"description": "Spotlight起動時にIMEを英数にする",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar",
@ryonakae
ryonakae / index.html
Last active October 24, 2017 08:50
Frontend de KANPAI! #02 - エンジョイ!フロントエンド - 「Payment Request APIで実現できる Web決済の体験」
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Payment Request API Test</title>
<style>
body {
color: #333;
padding: 20px;
<?php
if (!function_exists('getallheaders')) {
function getallheaders() {
$headers = array();
foreach ($_SERVER as $name => $value) {
if (substr($name, 0, 5) == 'HTTP_') {
$headers[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
}
}