Undo a git stash

You can just run: and it will unstash your changes. If you want to preserve the state of files (staged vs. working), use

ruby operator “=~” [duplicate]

The =~ operator matches the regular expression against a string, and it returns either the offset of the match from the string if it is found, otherwise nil. You can place the string/regex on either side of the operator as you can see above.

How do I print colored output to the terminal in Python?

Would the Python termcolor module do? This would be a rough equivalent for some uses. The example is right from this post, which has a lot more. Here is a part of the example from docs A specific requirement was to set the color, and presumably other terminal attributes, so that all following prints are that way. While I … Read more

How can I clear or empty a StringBuilder?

ways that work: Use stringBuilderObj.setLength(0). Allocate a new one with new StringBuilder() instead of clearing the buffer. Note that for performance-critical code paths, this approach can be significantly slower than the setLength-based approach (since a new object with a new buffer needs to be allocated, the old object becomes eligible for GC etc).

What characters must be escaped in HTML 5?

The specification defines the syntax for normal elements as: Normal elements can have text, character references, other elements, and comments, but the text must not contain the character U+003C LESS-THAN SIGN (<) or an ambiguous ampersand. Some normal elements also have yet more restrictions on what content they are allowed to hold, beyond the restrictions imposed by … Read more