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
git log --format="%h %s" --cherry-pick --oneline --left-only --no-merges develop...master | | |
while read cmt_log | |
do | |
cmt_msg=`echo "${cmt_log}" | awk '{ $1=""; print }'` | |
git log --format=" %s" develop..master | grep --fixed-string -s "${cmt_msg}" > /dev/null || echo ${cmt_log} | |
done | |
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 ao = { | |
g: 3, | |
acd: 3, | |
a: 1, | |
b: 2, | |
ddd:6, | |
delete: 1, | |
d: 3, | |
ccc: 1, | |
}; |
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
// create context with no upfront defaultValue | |
// without having to do undefined check all the time | |
function createCtx<A>() { | |
const ctx = React.createContext<A | undefined>(undefined) | |
function useCtx() { | |
const c = React.useContext(ctx) | |
if (!c) throw new Error("useCtx must be inside a Provider with a value") | |
return c | |
} | |
return [useCtx, ctx.Provider] as const |
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
os.Setenv("HTTP_PROXY", "http://127.0.0.1:9999") | |
baseURL := "http://google.com" | |
resp, err := http.Get(baseURL) |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Recording</title> | |
</head> |
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 { data } = await axios.get(url, { | |
responseType: 'arraybuffer', | |
headers: { | |
'Content-Type': 'audio/wav' | |
} | |
}); | |
const blob = new Blob([data], { | |
type: 'audio/wav' | |
}); |
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 partial = (fn, ...args) => fn.bind(null, ...args); | |
const add3 = (a, b, c) => a + b + c; | |
const inc = partial(add3, 1, 2); | |
const result = inc(3); | |
console.log(result) //6 |
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 groupArray(array []int, length int) [][]int { | |
var group [][]int | |
if length > len(array) { | |
return nil | |
} | |
for len(array) > length { | |
var newArray []int | |
newArray = append(newArray, array[:length]...) | |
group = append(group, newArray) | |
array = append(array[:0], array[length:]...) |
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 group = (arr = [], length = 2) => { | |
if (length > arr.length) return; | |
const newArr = arr.slice(); | |
const returnArr = []; | |
while (newArr.length > length) { | |
const values = newArr.splice(0, length); | |
returnArr.push(values); | |
} | |
returnArr.push(newArr); | |
return returnArr; |
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 compose = (...fns) => arg => | |
fns.reduce((composed, fn) => fn(composed), arg); | |
const toUpper = str => str.toUpperCase(); | |
const splitWithSign = sign=>str=>str.split(sign); | |
const newStrs = compose(toUpper,splitWithSign('|'))('a|bc'); | |
console.log(newStrs) |
NewerOlder