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
def wait_until_true(func, timeout_ms \\ 5000) do | |
do_wait_until_true(func, :os.system_time(:milli_seconds) + timeout_ms) | |
end | |
def do_wait_until_true(func, unix_limit_time) do | |
IO.inspect("attempt") | |
cond do | |
func.() -> | |
true |
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
# dump | |
mysqldump -u {user} --column-statistics=0 --no-tablespaces -p --password={pwd} -h 127.0.0.1 {dbname} > full_db_export.sql | |
# load | |
mysql -u {user} --password={pwd} -h 127.0.0.1 -D {dbname} < full_db_export.sql |
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 calcDelay(init time.Time) float64 { | |
diff := time.Now().UnixNano() - init.UnixNano() | |
return float64(diff) / float64(time.Second) | |
} | |
func main(){ | |
preTime := time.Now() | |
calcDelay(preTime) | |
} |