# find dangling commit hash in the git history
git fsck --no-reflog | awk '/dangling commit/ {print $3}'
# view in git log
glog $(git fsck --no-reflog | awk '/dangling commit/ {print $3}')
# then apply it back
git stash apply {dropped_stash_hash}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -------------------------------------------------- | |
// require modules | |
// -------------------------------------------------- | |
const pkg = require('./package.json') | |
const path = require('path').posix | |
const exec = require('child_process').execSync | |
const BannerPlugin = require('webpack/lib/BannerPlugin.js') | |
// -------------------------------------------------- | |
// Prerender routes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "net/http" | |
func main() { | |
mux := http.NewServeMux() | |
// add a "/files" route from the "./static" directory, http://localhost:8080/files/{file} | |
mux.Handle("/files/", http.StripPrefix("/files/", http.FileServer(utils.NewIndexlessDir("./static")))) | |
http.ListenAndServe(":8080", mux) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// steps: | |
// | |
// [1] install @angular-builders/custom-webpack | |
// | |
// [2] update angular.json for custom webpack configuration | |
// | |
// "architect": { | |
// "build": { | |
// // "builder": "@angular-devkit/build-angular:browser", | |
// "builder": "@angular-builders/custom-webpack:browser", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;= @echo off | |
;= rem Call DOSKEY and use this file as the macrofile | |
;= %SystemRoot%\system32\doskey /listsize=1000 /macrofile=%0% | |
;= rem In batch mode, jump to the end of the file | |
;= goto:eof | |
;= Add aliases below here | |
e.=explorer . | |
gs=git status $* | |
gb=git branch -a $* | |
gc=git checkout $* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set "PATH=%ConEmuBaseDirShort%\wsl;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe --wsl -cur_console:pm:/mnt -cur_console:t:"zsh" -t zsh -l |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- PSQL | |
CREATE SEQUENCE {tableName}_{tableColumn}_seq; | |
ALTER SEQUENCE {tableName}_{tableColumn}_seq OWNED BY {tableName}.{tableColumn}; | |
ALTER TABLE {tableName} | |
ALTER COLUMN {tableColumn} SET DEFAULT nextval('{tableName}_{tableColumn}_seq'::regclass); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format | |
# Working directory | |
# . or absolute path, please note that the directories following must be under root | |
root = "." | |
# Optional! If `watch_dir` is empty, use `root`. | |
watch_dir = "" | |
tmp_dir = "tmp" | |
[build] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const NUM_EXP = /^(\+|-)?(\d+)(\.\d+)?$/ | |
const PERCENT_EXP = /^(\+|-)?(\d+)(\.\d+)?%$/ | |
const CSV_COLUMN_EXP = /^"(.*)"$/g | |
const NULL_VALUES = [ '' ] | |
const CSV_OPTIONS = { | |
flip: false, |
NewerOlder