format | e.g |
---|---|
dd/MMM/yyyy:HH:mm:ss ZZZZ | 19/Apr/2010:06:36:15 -0700 |
dd/MMM/yyyy HH:mm:ss | 09/Mar/2004 22:02:40 08691 |
MMM dd, yyyy hh:mm:ss a | Dec 2, 2010 2:39:58 AM |
MMM dd yyyy HH:mm:ss | Jun 09 2011 15:28:14 |
MMM dd HH:mm:ss yyyy | Apr 20 00:00:35 2010 |
MMM dd HH:mm:ss ZZZZ yyyy | Feb 07 15:22:31 -0700 2016 |
MMM dd HH:mm:ss ZZZZ | Sep 28 19:00:00 +0000 |
MMM dd HH:mm:ss | Mar 16 08:12:04 |
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 Test(t *testing.T) { | |
a := map[int]int{ | |
} | |
var b sync.Map | |
for i := 0; i < 2000; i++ { | |
a[i] = i | |
} | |
var wg sync.WaitGroup | |
wg.Add(2000) |
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 ( | |
"reflect" | |
"testing" | |
"github.com/aws/aws-sdk-go/aws/request" | |
) | |
func BenchmarkFooF(b *testing.B) { |
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
go test -run=. -bench=. -benchtime=5s -count 5 -benchmem -cpuprofile=cpu.out -memprofile=mem.out -trace=trace.out ./package | tee bench.txt | |
go tool pprof -http :8080 cpu.out | |
go tool pprof -http :8081 mem.out | |
go tool trace trace.out | |
go tool pprof $FILENAME.test cpu.out | |
# (pprof) list <func name> | |
# go get -u golang.org/x/perf/cmd/benchstat | |
benchstat bench.txt |
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 ( | |
"bytes" | |
"strings" | |
"testing" | |
) | |
func BenchmarkStringAppend(b *testing.B) { | |
for i := 0; i < b.N; i++ { |
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
SetTitleMatchMode, 2 | |
#IfWinActive Zim ahk_class gdkWindowToplevel | |
!1:: | |
SendInput, {AppsKey}e{Tab}{Tab}{Tab}{Tab}100{Enter}{Enter} | |
return | |
!2:: | |
SendInput, {AppsKey}e{Tab}{Tab}{Tab}{Tab}200{Enter}{Enter} | |
return | |
!3:: |
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
[alias] | |
st = status | |
co = checkout | |
br = branch | |
ci = commit -av --no-status -q | |
unstage = reset HEAD -- | |
last = log -1 HEAD | |
recent = for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) %(refname:short)' | |
logd = log --decorate | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit |
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
#!/usr/bin/env bash | |
set -eu | |
doWork() { | |
# make modifications here | |
git br -d $i | |
} | |
for i in $(ls); do |
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
/* | |
Usage: | |
timeStr := Get_now() | |
MsgBox, %timeStr | |
*/ | |
Get_now() | |
{ | |
global | |
UTCFormatStr := "yyyy-MM-dd'T'HH:mm:ss" |
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
Get-ChildItem '.*' | foreach {$_.Attributes = $_.Attributes -bor "Hidden"} | |
# Hide all files and folders that starts with . | |
# I use this to clean up my home directory. |
NewerOlder