Skip to content

Instantly share code, notes, and snippets.

Avatar

Teppei Sato teppeis

View GitHub Profile
@teppeis
teppeis / README.md
Created Mar 15, 2018 — forked from prog893/README.md
ECS Container Instance scale-in protector
View README.md
View post-checkout
#!/bin/bash
#
# Check package.json and npm install after git checkout.
# Put this to .git/hooks/post-checkout
#
PREVIOUS_HEAD=$1
NEW_HEAD=$2
BRANCH_SWITCH=$3
@teppeis
teppeis / es-class-fields.md
Last active Mar 13, 2022
ES Class Fieldsのプライベートフィールドがハッシュな変態記法なのは何でなんだぜ?
View es-class-fields.md

ES Class Fields (Stage 2 now)

プライベートフィールドがハッシュな変態記法なのは何でなんだぜ?

class Point {
    #x;
    #y;
 constructor(x = 0, y = 0) {
@teppeis
teppeis / tenkaichi-git.md
Last active Feb 8, 2022
天下一gitconfig大会
View tenkaichi-git.md

天下一gitconfig大会(サイボウズ社内git勉強会@2012/11/20)の@teppeisの資料です。

ぎっとぎとにしてやんよ

DojoCat

GistDeck

  • gistでmarkdown書いたらbookmarkletでプレゼンになるよ。
@teppeis
teppeis / install-ricty.sh
Last active Jun 16, 2021
Install Ricty font for Ubuntu
View install-ricty.sh
#!/bin/sh
sudo apt-get install fontforge fonts-inconsolata
mkdir -p ~/.fonts
TMPDIR=$(mktemp -d /tmp/ricty-XXXXX)
cd $TMPDIR
wget http://iij.dl.sourceforge.jp/mix-mplus-ipa/59022/migu-1m-20130617.zip
View connect-airpods.sh
# derived from https://yoshiori.hatenablog.com/entry/2021/04/13/171405
AIR_PODS_ADDRESS="aa-aa-aa-aa-aa-aa"
AIR_PODS_NAME="XXX AirPods Pro"
/usr/local/bin/bluetoothconnector -c $AIR_PODS_ADDRESS
for ((i=0 ; i<10 ; i++))
do
if [ "Connected" == "$(/usr/local/bin/bluetoothconnector -s $AIR_PODS_ADDRESS)" ]; then
# sleep 0.5
@teppeis
teppeis / jquery-release-notes.md
Last active Jan 8, 2020
jQuery Release Notes
View jquery-release-notes.md
View gist:6e0f2d823a94de4ae442
/// <reference path="typings/node/node.d.ts" />
/// <reference path="typings/typescript/typescript.d.ts" />
import ts = require("typescript");
import fs = require("fs");
import path = require("path");
function transform(contents: string, libSource: string, compilerOptions: ts.CompilerOptions = {}) {
// Generated outputs
var outputs = [];
@teppeis
teppeis / gist:c50743a60832560aa1df
Last active May 22, 2019
Break the Web: Object staticメソッドがES6で仕様変更になった件について
View gist:c50743a60832560aa1df

Break the Web: Object static methods no longer throw errors for primitives!

Object.keys等のstaticメソッドがES6で挙動が変わったことで面倒なことになってる話

何が変わったか

ES5でプリミティブを受け取ると例外を投げていたObject.keys等のメソッドが、ES6では例外を吐かなくなった。

  • Object.getPrototypeOf ( O )
  • Object.getOwnPropertyDescriptor ( O, P )
@teppeis
teppeis / coverage.js
Created Feb 27, 2018 — forked from ebidel/coverage.js
CSS/JS code coverage during lifecycle of page load
View coverage.js
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*
* Shows how to use Puppeeteer's code coverage API to measure CSS/JS coverage across
* different points of time during loading. Great for determining if a lazy loading strategy
* is paying off or working correctly.
*
* Install:
* npm i puppeteer chalk cli-table