This file contains 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
# Ref: https://x.com/naoya_ito/status/1763034484843381187?s=20 | |
git for-each-ref refs/tags refs/heads --sort=-committerdate --format="%(if:equals=commit)%(objecttype)%(then)branch%(else)%(objecttype)%(end)˞%(HEAD) %(refname:lstrip=2)˞%(objectname:short)˞%(if)%(upstream:remoteref)%(then) [%(upstream:lstrip=2)]%(end) %(subject) %(upstream:track)" | column -t -s ˞ | fzf -i --layout=reverse --preview-window=down:50% --preview="git show --no-patch --pretty=format:'Date: %ci (%cr)%nAuthor: %an <%ae>%nHash: %H%nBody:%n%b' {2}" | tr '*' ' ' | awk '{print $2}' | xargs -o git checkout |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<link href="./styles.css" rel="stylesheet"> | |
<title>Hello World!</title> | |
</head> | |
<body> | |
<h1>Hello World!</h1> |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'"> | |
<link href="./styles.css" rel="stylesheet"> | |
<title>Hello World!</title> | |
</head> | |
<body> |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP --> | |
<link href="./styles.css" rel="stylesheet"> | |
<title>Hello World!</title> | |
</head> | |
<body> | |
<h1>Hello World!</h1> |
This file contains 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 {app, BrowserWindow} = require('electron') | |
async function createWindow () { | |
const mainWindow = new BrowserWindow({ | |
width: 800, | |
height: 600, | |
}) | |
mainWindow.loadURL('https://socket.io/demos/chat') |
This file contains 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 {app, BrowserWindow} = require('electron') | |
async function createWindow () { | |
const mainWindow = new BrowserWindow({ | |
width: 800, | |
height: 600, | |
}) | |
mainWindow.loadURL('https://socket.io/demos/chat') |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<style> | |
@font-face { | |
font-family: system; | |
font-style: normal; | |
font-weight: 300; | |
src: local(".NewYork-Regular"); |
This file contains 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
type ObjKeyof<T> = T extends object ? keyof T : never | |
type KeyofKeyof<T> = ObjKeyof<T> | { [K in keyof T]: ObjKeyof<T[K]> }[keyof T] | |
type StripNever<T> = Pick<T, { [K in keyof T]: [T[K]] extends [never] ? never : K }[keyof T]>; | |
type Lookup<T, K> = T extends any ? K extends keyof T ? T[K] : never : never | |
type SimpleFlatten<T> = T extends object ? StripNever<{ [K in KeyofKeyof<T>]: | |
Exclude<K extends keyof T ? T[K] : never, object> | | |
{ [P in keyof T]: Lookup<T[P], K> }[keyof T] | |
}> : T | |
type NestedFlatten<T> = SimpleFlatten<SimpleFlatten< | |
SimpleFlatten<SimpleFlatten<SimpleFlatten<T>>>>>; |
This file contains 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
{"index":{ "_index": "books", "_type": "IT", "_id": "1" }} | |
{"id":"1","title":"Java编程思想","language":"java","author":"Bruce Eckel","price":70.20,"publish_time":"2007-10-01","description":"Java学习必读经典,殿堂级著作!赢得了全球程序员的广泛赞誉。"} | |
{"index":{ "_index": "books", "_type": "IT", "_id": "2" }} | |
{"id":"2","title":"Java程序性能优化","language":"java","author":"葛一鸣","price":46.50,"publish_time":"2012-08-01","description":"让你的Java程序更快、更稳定。深入剖析软件设计层面、代码层面、JVM虚拟机层面的优化方法"} | |
{"index":{ "_index": "books", "_type": "IT", "_id": "3" }} | |
{"id":"3","title":"Python科学计算","language":"python","author":"张若愚","price":81.40,"publish_time":"2016-05-01","description":"零基础学python,光盘中作者独家整合开发winPython运行环境,涵盖了Python各个扩展库"} | |
{"index":{ "_index": "books", "_type": "IT", "_id": "4" }} | |
{"id":"4","title":"Python基础教程","language":"python","author":"Helant","price":54.50,"publish_time":"2014-03-01","description":"经典的Python入门教程,层次鲜明,结构严谨,内容翔实"} | |
{"index":{ "_index": "books", "_type": "IT", "_id": "5" }} | |
{"id":"5","title":"JavaScript高级程序设计","language":"javascript","auth |
This file contains 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 existsSync = require('fs').existsSync; | |
const execSync = require('child_process').execSync; | |
const isWin = process.platform === 'win32'; | |
let winWmic = ''; | |
const wmicFilePath = process.env.WINDIR + '\\system32\\wbem\\wmic.exe'; | |
try { | |
const getWmic = (() => { | |
if (winWmic) return winWmic; |