Skip to content

Instantly share code, notes, and snippets.

View ishowta's full-sized avatar
😛

iwatachan ishowta

😛
View GitHub Profile
@seeliang
seeliang / lint-only-changed-files.MD
Last active June 10, 2024 05:37
How to lint only changed files?

find out the differences

use git diff to generate file list

git diff --name-only master

limited to certain file types

add ext filter

@slava-vishnyakov
slava-vishnyakov / readme.md
Last active June 28, 2024 19:01
How to upload images with TipTap editor
  1. Create a file Image.js from the source below (it is almost a copy of Image.js from tiptap-extensions except that it has a constructor that accepts uploadFunc (function to be called with image being uploaded) and additional logic if(upload) { ... } else { ... previous base64 logic .. } in the new Plugin section.
import {Node, Plugin} from 'tiptap'
import {nodeInputRule} from 'tiptap-commands'

/**
 * Matches following attributes in Markdown-typed image: [, alt, src, title]
 *
@william8th
william8th / .tmux.conf
Last active July 4, 2024 11:36
Tmux open new pane in same directory
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B)
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
# Set new panes to open in current directory
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
@wonderful-panda
wonderful-panda / _runner.ts
Last active August 19, 2021 18:34
[TypeScript] 期待した通りのコンパイルエラーが出るかどうかテストするやつ
/*
* 1. ../tsconfig.json に設定ファイルを置く
* 2. ../cases/ の中に example.ts みたいなファイルを置く (/// TSXXXX: ~ でその行で期待するコンパイルを記述する。~の部分は正規表現)
* 3. _runner.ts を ava で実行すると、出力サンプルみたいな感じで結果が出力される
*/
import * as ts from "typescript/lib/typescript";
import * as fs from "fs";
import * as path from "path";
import * as glob from "glob";
@elliotlarson
elliotlarson / firebase.admin.repl.js
Last active April 21, 2021 13:44
Simple Node.js Firebase repl
#!/usr/bin/env node
// Using the firebase-admin approach where database security rules do not apply.
// Here you are authenticating with a private key. The key JSON file is available via
// the Firebase web UI: project settings > service accounts > generate new private key.
var admin = require("firebase-admin");
admin.initializeApp({
credential: admin.credential.cert(".adminServiceAccountKey.json"),
@voluntas
voluntas / webrtc.rst
Last active June 27, 2024 02:25
WebRTC コトハジメ