Skip to content

Instantly share code, notes, and snippets.

View vvakame's full-sized avatar
💭
❤️ 🐈

Masahiro Wakame vvakame

💭
❤️ 🐈
View GitHub Profile
@vvakame
vvakame / gcpslog_handler.go
Created April 1, 2023 12:56
slog handler implementation for Google Cloud Platform
package gcpslog
import (
"context"
"fmt"
"golang.org/x/exp/slog"
"io"
"os"
"runtime"
"strconv"
@vvakame
vvakame / graphql-schema.js
Last active July 10, 2019 06:55
*.graphql to schema.json
// from https://blog.apollographql.com/three-ways-to-represent-your-graphql-schema-a41f4175100d
// https://blog.apollographql.com/modularizing-your-graphql-schema-code-d7f71d5ed5f2
const fs = require("fs");
const glob = require("glob");
const { graphqlSync, getIntrospectionQuery } = require("graphql");
const { makeExecutableSchema } = require("graphql-tools");
const typeDefs = glob
.sync("../graphql/*.graphql")
@vvakame
vvakame / index.ts
Created December 7, 2017 09:58
TypeScript + Redux なアレ(React+Redux 3日やってみはじめて期限に間に合わないと判断し作業をやめた人なので信頼性があるかは申し訳ないですが謎です…
import { createStore, applyMiddleware, combineReducers } from "redux";
import thunk from "redux-thunk";
import { userReducer, UserAction, UserState } from "./user";
import { handshakeReducer, HandShakeAction, HandshakeState } from "./handshake";
import { productInfoReducer, ProductInfoAction, ProductInfoState } from "./product";
import { circleReducer, CircleAction, CircleState } from "./circle";
export const store = createStore(combineReducers({
user: userReducer,
aaa
interface Hello {
hello(): string;
}
interface Named {
name: string;
}
function parrot<T extends Named>(obj: T): T {
return obj;
}
@vvakame
vvakame / index.js
Last active November 24, 2016 14:49
ECMAScript 2016 compatible class inheritance
"use strict";
{ // sample
class Base {
static hello() {
return "test";
}
}
class Inherit extends Base {
}
@vvakame
vvakame / .gitignore
Last active November 23, 2016 10:47
TypeScript+TSX with --jsxFactory issue ( https://github.com/Microsoft/TypeScript/issues/12467 )
node_modules/
npm-debug.log
.vscode
*.js
@vvakame
vvakame / .gitignore
Last active November 3, 2016 08:20
SkateJS + TypeScript(TSX). see README.md
node_modules/
.vscode/
npm-debug.log
index.js
index.jsx