30 seconds of code provides a curated collection of short code snippets for all your development needs. Our collection spans many topics, ranging from simple coding problems to theoretical concepts and development techniques.
Git, Repository
Adds a new submodule to the repository.
Git, Configuration
Configures git to autocorrect mistyped commands.
Git, Branch
Creates and switches to a new branch, optionally setting up a remote tracking branch.
Git, Repository
Deletes a submodule from the repository.
Git, Branch
Discards all untracked changes to the current branch.
Git, Branch
Rebases the current branch onto another branch.
Git, Branch
Renames a local branch.
Git, Branch
Switches to an existing branch.
Git, Branch
Switches back to the last branch.
Git, Branch
Prints the current status of the working tree.
Python, String
Returns the length of a string in bytes.
Python, String
Capitalizes the first letter of every word in a string.
Python, Math
Calculates the factorial of a number.
Python, String
Generates a string with the given string value repeated n
number of times.
JavaScript, Math
Checks if two numbers are approximately equal to each other.