This file contains hidden or 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
prefix = "http://"; | |
url = "http://example.com"; | |
url.substring(0, prefix.length) === prefix; // true |
This file contains hidden or 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
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist |
This file contains hidden or 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
git name-rev --name-only $(git rev-parse HEAD) |
This file contains hidden or 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
private static RegExp buildRegexpLangRfc5646() | |
{ | |
String extLang = "([A-Za-z]{3}(-[A-Za-z]{3}){0,2})"; | |
String language = | |
"(([a-zA-Z]{2,3}(-" + extLang + ")?)|([a-zA-Z]{5,8}))"; | |
String script = "([A-Za-z]{4})"; | |
String region = "([A-Za-z]{2}|\\d{3})"; | |
String variant = "([A-Za-z0-9]{5,8}|(\\d[A-Z-a-z0-9]{3}))"; | |
String singleton = "(\\d|[A-W]|[Y-Z]|[a-w]|[y-z])"; | |
String extension = "(" + singleton + "(-[A-Za-z0-9]{2,8})+)"; |
This file contains hidden or 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
git rev-parse: RefName ======> SHA1 | |
git name-rev: SHA1 <===== RefName | |
# Convert the reference name HEAD to its corresponding SHA1 | |
git rev-parse HEAD # Assuming for the sake of example that it outputs 1234567 | |
# Convert the SHA1 (1234567) into its reference name (should output HEAD in our example) | |
git name-rev 1234567 | |
# or else |

This file contains hidden or 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
Cherry pick the commits from a through z (assuming SHA1 a is older than z) | |
git rev-list --reverse --topo-order a^..z | xargs -n 1 git cherry-pick | |
The below code does not work as it will squash all the commits (a..z) in a single one. | |
git cherry-pick a..z |