All Go Rust Python PHP JavaScript
Chrome Dev Summit to secure your spot in workshops, office hours and learning lounges!

How to Get Current Time in Milliseconds in Python

In Python, there are 3 ways to get current time in milliseconds. Using time Method The time.time() method returns the time in seconds since the epoch as a floating point number. For example, #!/usr/bin/python3 # Import module import time ms =...
Patcher56

How to Check for NaN Values in Python

In Python, there are 2 ways to check for NaN values. Using math.isnan Method The math.isnan(x) method returns True if x is a NaN (not a number), and False otherwise. For example, #!/usr/bin/python3 # Import module import math f = float('nan') ...
ada

How to Subtracting time.Duration from Time in Go

In Golang, using the time.Duration function is the easiest way to subtract time from a time.Time Using time.Duration Function A Duration represents the elapsed time between two instants as an int64 nanosecond count. The representation limits the la...
Tomoki

How to Parse Unix Timestamp to time.Time in Go

In Golang, using the time.Unix() function is the easiest way to parse unix timestamp to time.Time Using time.Unix Function You can directly use time.Unix function of time which converts the unix time stamp to UTC. See the following example: pa...
pooriabt

How To Install Go in Linux

In Golang, there are 2 ways to install Go in Linux.Download Packages Download packages for Windows 64-bit, macOS, Linux, and more. Go install Linux Remove any previous Go installation by deleting the /usr/local/go folder (if it exists), then extr...
Unused

How To Install Rust in Linux

In Rust, there are two ways to install rust in Linux.Running the following in your terminal If you’re running macOS, Linux, or another Unix-like OS. To download Rustup and install Rust, run the following in your terminal, then follow the on-screen i...
pooriabt

How to format a date or time in Go

In Golang, there are two ways to format the time.The layout string Go doesn’t use yyyy-mm-dd layout to format a time. Instead, you format a special layout parameter. 2006-01-02 15:04:05.999999999 -0700 MST package main import ( "fmt" "tim...
aweis

How to shuffle a slice in Go

Shuffling a Slice in Golang.Using rand.Shuffle Function Shuffle pseudo-randomizes the order of elements using the default Source. package main import ( "fmt" "math/rand" "time" ) func main() { s := []string{"Japan", "Germany", "France"} ...
ada

How to generate a random string in Go

Creating Random Strings of a fixed length in Go. Using rand.Int63 Function Int63 returns a non-negative pseudo-random 63-bit integer as an int64 from the default Source. package main import ( "fmt" "math/rand" "time" ) const letters = "a...
ada

How to use the find command in Linux

search for files and directories based on their permissions, type, date, ownership, size, and more. find is a command-line utility that locates files based on some user-specified criteria and either prints the pathname of each matched object or, if ...

How to use the go command line

Go is a tool for managing Go source code. Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. Go install. 1. Extract the archive you downloaded into /usr/local, creating a Go tree ...

How to install Anime.js

Anime.js is a lightweight JavaScript animation library with a simple, yet powerful API.--pname-- is a lightweight JavaScript animation library with a simple, yet powerful API. It works with CSS properties, SVG, DOM attributes and JavaScript Objects. ...