Open ~/.bash_profile in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {| CREATE TABLE `common_us_states` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `code` char(2) NOT NULL DEFAULT '', | |
| `name` varchar(50) NOT NULL DEFAULT '', | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| insert into common_us_states (code,name) values ('AL','Alabama'); | |
| insert into common_us_states (code,name) values ('AK','Alaska'); | |
| insert into common_us_states (code,name) values ('AS','American Samoa'); |
| CREATE TABLE `common_de_bundeslaender` ( | |
| `id` int(11) NOT NULL AUTO_INCREMENT, | |
| `code` char(2) NOT NULL DEFAULT '', | |
| `name` varchar(30) NOT NULL DEFAULT '', | |
| PRIMARY KEY (`id`) | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
| insert into common_de_bundeslaender (code,name) values ('BW','Baden-Württemberg'); | |
| insert into common_de_bundeslaender (code,name) values ('BY','Bayern'); | |
| insert into common_de_bundeslaender (code,name) values ('BE','Berlin'); |
| const matchDark = '(prefers-color-scheme: dark)' | |
| function useDarkMode() { | |
| const [isDark, setIsDark] = React.useState( | |
| () => window.matchMedia && window.matchMedia(matchDark).matches | |
| ) | |
| React.useEffect(() => { | |
| const matcher = window.matchMedia(matchDark) | |
| const onChange = ({ matches }) => setIsDark(matches) |
| function useClickOutside(elRef, callback) { | |
| const callbackRef = React.useRef() | |
| callbackRef.current = callback | |
| React.useEffect(() => { | |
| const handleClickOutside = e => { | |
| if (elRef?.current?.contains(e.target) && callbackRef.current) { | |
| callbackRef.current(e) | |
| } |
| *://www.amazon.de/* | |
| *://www.amazon.com/* | |
| *://www.facebook.com/* | |
| *://www.ebay.com/* | |
| *://www.microsoft.com/* | |
| *://www.apple.com/* | |
| *://www.instagram.com/* | |
| *://www.wikipedia.org/* | |
| *://www.t-online.de/* | |
| *://www.bild.de/* |
| { | |
| "peacock.favoriteColors": [ | |
| { | |
| "name": "Angular Red", | |
| "value": "#b52e31" | |
| }, | |
| { | |
| "name": "Auth0 Orange", | |
| "value": "#eb5424" | |
| }, |
| // Example usage: | |
| // | |
| // void async function() { | |
| // let [clicks, onclick] = iterator() | |
| // document.querySelector('button').addEventListener('click', onclick) | |
| // for await (let click of clicks) console.log(click) | |
| // }() | |
| export default function iterator() { | |
| let done = false |
Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.
####Search, Go to, Navigation ####
Cmd + P - Search file
Cmd + Shift + O - Search everywhere
(I swapped the above two recently because I use Cmd + P to search for files most of the time).
| // merge branch test to master | |
| git checkout master | |
| git pull origin master | |
| git merge test | |
| git push origin master | |
| git branch -d test |