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

How to Make First Letter of Words Uppercase in a String in Go

In Golang, using the cases package is the easiest way to make first letter of words uppercase in a string. Using cases Package install Use the following command to download the repository to the local file system. install go mod tidy ...
pooriabt

How to Create Multiline Comments in Python

In Python, using the triple-quoted strings is the easiest way to create multiline comments. Using triple-quoted Strings String literals can span multiple lines. One way is using triple-quotes: """...""" or '''...'''. You can use triple-quoted strin...
aweis

How to Prettyprint a JSON File in Python

In Python, there are 2 ways to prettyprint a JSON file. Using json module The json module already implements some basic pretty printing in the dump and dumps functions, with the indent parameter that specifies how many spaces to indent by: #!/us...
Patcher56

How to Generate a UUID in Go

In Golang, there are 4 ways to generate a uuid. Using uuid Package install Use the following command to download the repository to the local file system. install go mod tidy go get github.com/google/uuid go install github.com...
Sambhav Khandelwal

How to List all Standard Packages in Go

In Golang, there are 2 ways to list all standard packages. Using packages go install Use the following command to download the repository to the local file system. install go get golang.org/x/tools/go/packages go install golang.or...
aweis

How to Remove Packages Installed with go get in Go

In Golang, there are 3 ways to remove packages installed with go get. Using go mod tidy go mod tidy ensures that the go.mod file matches the source code in the module. It adds any missing module requirements necessary to build the current module’s p...
ada

How To Split a list into equally sized chunks in Python

In Python, there are 3 ways to split a list into equally sized chunks. Using List Comprehension List comprehensions provide a concise way to create lists. The following example: #!/usr/bin/python3 # -*- coding: utf8 -*- # initialize lst = ['a'] *...
Patcher56

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

Hello World in Rust

In Rust, "Hello World!" is the first basic program. Build and Run In our main.rs, add the following code: // main.rs fn main() { println!("Hello,世界,こんにちは,안녕하세요") } Hello,世界,こんにちは,안녕하세요 we can run our application by typing: B...
pooriabt

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 define python source code encodings

Correct way to define Python source code encoding.PEP 263 Python will default to ASCII as standard encoding if no other encoding hints are given. PEP 263 defines how to declare Python source code encoding. Using Coding To define a source code encodin...
Tomoki

How to convert string to json in Python

Converting Json to string in Python.Decoding JSON To convert string to json in Python, use the json.loads() function. The json.loads() is a built-in Python function that accepts a valid json string and returns a dictionary to access all elements. The...
pooriabt

Hello World in Python

Hello, World! is the first basic program in any programming language.Python Version Print the Python version number and exit. Example output could be: Python version python -V python --version Python 3.9.1 Running Files with Command Lines You c...
ada

How to handle If-modified-since header in PHP

Reduce Bandwidth Usage by Supporting If-Modified-Since in PHP. If-Modified-Since The If-Modified-Since request HTTP header makes the request conditional: the server sends back the requested resource, with a 200 status, only if it has been last modif...
Patcher56

Hello World in Go

Hello, World! is the first basic program in any programming language.source code package main import "fmt" func main() { fmt.Println("Hello,世界,こんにちは,안녕하세요") } To run the program Go is a compiled language. The Go toolchain converts a source pro...
Tomoki