Skip to content

Instantly share code, notes, and snippets.

View kaave's full-sized avatar

Kyousuke Abe kaave

View GitHub Profile
@kaave
kaave / devcontainer.json
Created June 30, 2023 01:08
[Draft] My .devcontainer
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{
"name": "Ubuntu",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
// Programming languages
"ghcr.io/devcontainers/features/node:1": {
"nodeGypDependencies": true,
:root {
--height-header: 10rem;
--width-left: 20rem;
--color-fg: #24292f;
--color-canvas-sub: #f6f8fa;
--color-code: #cf222e;
}
html {
font-size: 62.5%;
@kaave
kaave / example.ts
Last active September 25, 2021 16:06
My Branded Type Pattern
import * as Hex from './hex';
const red = Hex.create('#f00');
const nonBrandedRed = '#f00';
function stdoutOnlyHex(hex: Hex) {
console.log(hex);
}
stdoutOnlyHex(red);
@kaave
kaave / convertScrapboxToMarkdown.ts
Last active August 9, 2021 07:05
Scrapbox のバックアップ json から Markdown を作成
import scrapboxData from '../scrapbox.json';
import fs from 'fs-extra';
import path from 'path';
const distPath = path.join(process.cwd(), 'dist');
async function main() {
fs.mkdirp(distPath);
scrapboxData.pages.forEach(page => {
@kaave
kaave / fn.ts
Created July 3, 2019 03:38
Cloud Functionsから認証付きのCloud Firestoreを突破
import * as admin from 'firebase-admin';
import * as functions from 'firebase-functions';
const validReferrers = [
'http://localhost:9012',
];
admin.initializeApp(functions.config().firebase);
const db = admin.firestore();
@kaave
kaave / addtype.bash
Last active March 28, 2019 10:47
WebMidi: get inputs sample
yarn add -D @types/webmidi
@kaave
kaave / .eslintignore
Created March 26, 2019 13:07
eslint with prettier, typescript, react, airbnb
**/*.d.ts

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@kaave
kaave / xmonad.hs
Created May 16, 2017 05:57
Xmonad config (tmp)
import XMonad
import XMonad.Hooks.EwmhDesktops -- for chrome's fullscreen mode
--
-- import XMonad.Config.Desktop
--
-- baseConfig = desktopConfig
main = do
xmonad $ defaultConfig
{ terminal = myTerminal
@kaave
kaave / tagtool.py
Created September 20, 2016 13:27
Add Get method to Felica reader sample code
def show_tag(self, tag):
# print tags
print(tag)
# create url values
url_values = urllib.urlencode({"read": tag})
# create request url
url = "http://localhost:8000/?" + url_values
print(" Request to: " + url)