默认 git stash
仅会将已经跟踪的文件存储,当工作区有为跟踪文件时,使用git stash --include-untracked
可以将所有文件存储起来。
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
adb shell settings get global device_name | |
adb shell settings put global device_name "Pixel-2L" | |
adb shell settings put global http_proxy 192.168.199.233:8888 |
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
local function Chinese() | |
-- 简体拼音 | |
hs.keycodes.currentSourceID("com.apple.inputmethod.SCIM.ITABC") | |
end | |
local function English() | |
-- ABC | |
hs.keycodes.currentSourceID("com.apple.keylayout.ABC") | |
end |
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
function calcREM() { | |
var docEl = document.documentElement; | |
var width = docEl.getBoundingClientRect().width; | |
var rem = width / 7.5; | |
rem = parseFloat(rem.toFixed(3)); | |
docEl.style.fontSize = rem + 'px'; | |
// 修正系统字体调整造成的布局问题 | |
var realitySize = parseFloat(window.getComputedStyle(document.documentElement).fontSize); | |
if (rem !== realitySize) { | |
rem = rem * rem / realitySize; |
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
function Promise(exec) { | |
const self = this; | |
self.status = "pending"; | |
self.value = undefined; | |
self.onResolvedCallbacks = []; | |
self.onRejectedCallbacks = []; | |
function resolve(value) { | |
if (self.status === "pending") { | |
setTimeout(() => { |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"net" | |
"time" | |
) |
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
func combinationSum2(candidates []int, target int) [][]int { | |
sort.Ints(candidates) | |
var result [][]int | |
var dfs func([]int, int, []int, int) | |
dfs = func(candidates []int, startIndex int, currentSet []int, newTarget int) { | |
if newTarget == 0 { | |
newSet := make([]int, len(currentSet)) | |
copy(newSet, currentSet) | |
result = append(result, newSet) | |
return |
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
function qsort(arr) { | |
partSort(arr, 0, arr.length - 1); | |
} | |
function partSort(arr, start, end) { | |
if (start >= end) { | |
return; | |
} | |
const p = arr[end]; | |
let left = start; | |
let right = end; |
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
func removeElement(nums []int, val int) int { | |
start := 0 | |
current := 0 | |
for current < len(nums) { | |
if nums[current] != val { | |
nums[start] = nums[current] | |
start++ | |
} | |
current++ |
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
func removeDuplicates(nums []int) int { | |
start := 0 | |
current := 1 | |
for current < len(nums) { | |
if nums[current] != nums[start] { | |
nums[start+1] = nums[current] | |
start++ | |
} | |
current++ | |
} |