Skip to content

Instantly share code, notes, and snippets.

View esnya's full-sized avatar

esnya

  • Japan
View GitHub Profile
@esnya
esnya / WorldNormal.shader
Created July 2, 2020 02:30
Unity用法線可視化シェーダー
// MIT License (c) http://github.com/esnya
Shader "Unlit/WorldNormal"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_BumpMap ("Texture", 2D) = "bump" {}
_BumpScale ("Normal Scale", Range(0, 1)) = 1.0
_MixFactor ("Mix Factor", Range(0, 1)) = 1
@esnya
esnya / .eslintrc.yml
Last active March 20, 2020 06:13
boilerplate
extends:
- typescript
- typescript/react
- typescript/prettier
- typescript/prettier-react
rules:
prettier/prettier:
- error
- singleQuote: true
trailingComma: all
@esnya
esnya / firestore-typed.ts
Last active October 15, 2019 09:02
firestore-typed
import { firestore } from 'firebase/app';
export type FieldPath = firestore.FieldPath;
export type FirestoreError = firestore.FirestoreError;
export type GetOptions = firestore.GetOptions;
export type OrderByDirection = firestore.OrderByDirection;
export type SetOptions = firestore.SetOptions;
export type SnapshotListenOptions = firestore.SnapshotListenOptions;
export type SnapshotOptions = firestore.SnapshotOptions;
@esnya
esnya / dice.scala
Last active July 4, 2016 05:04
`[n] d [m]` dice roll for Scala
package info.nekometer.ukatama.scala
object dice {
import scala.util.Random
class DiceResult(val sum: Int, val list: Seq[Int]) {
override def toString = "DiceResult(" + sum + "," + list + ")"
def penalty(i: Int): Int = sum - i
def p = penalty(_)
@esnya
esnya / crypto.d
Created June 26, 2016 04:46
Wrapper classes of OpenSSL RSA/DES-GCM encrypt/decrypt for D Language
import std.algorithm;
import std.conv;
import std.datetime;
import std.exception;
import std.stdio;
extern(C) int SSL_library_init();
static this() {
SSL_library_init();
}
@esnya
esnya / nekoproxy-how-to
Created May 10, 2016 15:28
Nekoproxyマニュアル草案
# Nekoproxy ドキュメント化前の覚書
## 機能
- リバースプロキシ
- etcdによるLive-Configuration
- `routes`を`etcd`に
- domain/url based routing
- TLS support
- マルチテナント
- 複数の独立したセッション・認証系
@esnya
esnya / flex-resposive.html
Last active March 28, 2016 14:58
Responsive design (?) by CSS flex-box
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Flex Responsive</title>
<style>
html, body, .container {
margin: 0;
padding: 0;
width: 100%;
@esnya
esnya / browser.js
Last active February 15, 2016 13:13
Browserify error after lint
console.log('hoge');
syntax error;
@esnya
esnya / eslint-acorn2.7-babel.js
Last active February 15, 2016 11:32
ESLint/Espree breaks Acorn?
'use strict';
/*
* syntax-error erroed after eslint executed.
*
* [email protected]
* [email protected]
* [email protected]
*/
@esnya
esnya / cached.js
Last active February 12, 2016 00:07
Promiseコード片
let hoge = null;
const getHoge = () => hoge
? Promise.resolve(hoge)
: new Promise((resolve, reject) => {
someAsnycWork((data) => {
hoge = data;
resolve(data);
})
});