Skip to content

Instantly share code, notes, and snippets.

View teppeis's full-sized avatar

Teppei Sato teppeis

View GitHub Profile
@teppeis
teppeis / gist:c50743a60832560aa1df
Last active April 29, 2023 15:04
Break the Web: Object staticメソッドがES6で仕様変更になった件について

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 / tenkaichi-git.md
Last active April 29, 2023 14:58
天下一gitconfig大会

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

ぎっとぎとにしてやんよ

DojoCat

  • gistでmarkdown書いたらbookmarkletでプレゼンになるよ。
@teppeis
teppeis / jquery-release-notes.md
Last active November 21, 2022 16:10
jQuery Release Notes
@teppeis
teppeis / README.md
Created March 15, 2018 03:41 — forked from prog893/README.md
ECS Container Instance scale-in protector
#!/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 March 13, 2022 13:57
ES Class Fieldsのプライベートフィールドがハッシュな変態記法なのは何でなんだぜ?

ES Class Fields (Stage 2 now)

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

class Point {
    #x;
    #y;
 constructor(x = 0, y = 0) {
@teppeis
teppeis / install-ricty.sh
Last active June 16, 2021 11:37
Install Ricty font for Ubuntu
#!/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
# 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
/// <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 / coverage.js
Created February 27, 2018 00:02 — forked from ebidel/coverage.js
CSS/JS code coverage during lifecycle of page load
/**
* @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