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 get github.com/fiam/gounidecode/unidecode | |
$ go get github.com/rainycape/unidecode | |
$ time go test github.com/fiam/gounidecode/unidecode | |
ok github.com/fiam/gounidecode/unidecode 0.039s | |
real 0m9.629s | |
user 0m1.621s | |
sys 0m1.647s |
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
# locale-gen | |
# eselect locale set ru_RU.utf8 | |
# . /etc/profile | |
eselect сам создаст /etc/env.d/02locale и внесёт в него нужные данные. | |
. /etc/profile обновит настройки текущей консоли | |
www.oldnix.org/rus-gentoo-linux/ чуть более объёмная статья на эту тему без которой можно обойтись двумя строчками. |
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
// удалить файлы старше 3 дней | |
find -type f -mtime +3 -exec rm -f {} \; | |
// для случаев когда удалённый ftp сервер работает с ошибками, а файлы получить как-то нужно: | |
// http://unix.stackexchange.com/questions/2525/sync-a-local-directory-with-a-remote-directory-in-linux | |
curlftpfs -r -s ftp.foobar.com /foo | |
rsync -a /foo/ /bar | |
umount /foo | |
// iTerm v2 |
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 ( | |
"fmt" | |
"log" | |
"os" | |
"path/filepath" | |
) | |
func main() { |
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 commit --amend --author=username@example.com | |
// запушить на github если там этот коммит уже был | |
git push origin master -f | |
// Изменение коммитов в Git - https://habrahabr.ru/post/201922/ | |
Если нужно обновить свой форк данными из источника: | |
1. идём в свой форк, находим справа над списком файлов кнопку Compare |
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 "fmt" | |
func main() { | |
c := make(chan int, 100) | |
for i := 0; i < 34; i++ { | |
c <- 0 | |
} | |
fmt.Println(len(c)) // print "34" |
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
// http://play.golang.org/p/JlYJXZnUxl | |
package main | |
import ( | |
"fmt" | |
"net" | |
) | |
func inet_aton(ip string) (ip_int uint32) { | |
ip_byte := net.ParseIP(ip).To4() |
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
// https://play.golang.org/p/sopEgcwRZC | |
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type Map struct { | |
sync.RWMutex |
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 NONE -bench . -gcflags -ssa=0 > nossa.txt | |
testing: warning: no tests to run | |
$ go test -run NONE -bench . -gcflags -ssa=1 > ssa.txt | |
testing: warning: no tests to run | |
$ benchcmp nossa.txt ssa.txt | |
benchmark old ns/op new ns/op delta | |
BenchmarkAdd-4 2.45 11.4 +365.31% | |
https://github.com/golang/go/issues/15925 |
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
How To Uninstall CrossOver Mac - https://www.youtube.com/watch?v=lWS65hceXt0 | |
Все обновления и временные файлы хранятся тут: /Users/$user/Documents/World_of_Tanks |
OlderNewer