File: Reveal Active File In Explorer View: CMD+1
focusActiveEditorGroup: CMD+2
terminal.focus: CMD+3
Abracadabra: Convert To Template: CMD+SHFT+'
Abracadabra: Extract: OPT+CMD+V
| // If script was included using a <script> tag | |
| const scriptPath = document.currentScript.src | |
| // If the script was included as an ESM module | |
| const scriptPath = import.meta.url |
File: Reveal Active File In Explorer View: CMD+1
focusActiveEditorGroup: CMD+2
terminal.focus: CMD+3
Abracadabra: Convert To Template: CMD+SHFT+'
Abracadabra: Extract: OPT+CMD+V
| #### | |
| # Some of my favorite things | |
| #### | |
| alias g="git" | |
| alias app="code ~/Development/app" | |
| #### | |
| # GIT PROMPT | |
| # adapted from: https://www.themoderncoder.com/add-git-branch-information-to-your-zsh-prompt/ | |
| # with additions from: https://salferrarello.com/zsh-git-status-prompt/ |
| set jiraID to display dialog "Jira ID?" default answer "" with icon note buttons {"Cancel", "Continue"} default button "Continue" | |
| open location "https://SCRUBBED.atlassian.net/browse/" & (text returned of jiraID) |
| [alias] | |
| aa = add --all ; add all files from workspace to stage | |
| ap = add -p ; interactively add files from workspace to stage | |
| c = commit -m ; commit with message - usage git c "message here" | |
| amend = commit --amend --no-edit ; amend last commit | |
| f = fetch --all --prune --tags; update local branch index from remotes | |
| fm = fetch origin main:main; update local main branch from remote main | |
| s = status | |
| b = branch | |
| ch = checkout |
| -- Derived from https://stackoverflow.com/a/34545062/2992570 | |
| DROP PROCEDURE IF EXISTS dropForeignKeyIfExists; | |
| delimiter /// | |
| create procedure dropForeignKeyIfExists(IN tableName VARCHAR(64), IN constraintName VARCHAR(64)) | |
| begin | |
| IF EXISTS( | |
| SELECT * FROM information_schema.table_constraints | |
| WHERE |
| # Backs up the data from a docker mysql instance to the host machine's file system | |
| docker-compose exec $MACHINEID mysqldump -uuser -ppass --all-databases > /host/machine/path/backup.sql | |
| # Or | |
| docker exec $MACHINEID mysqldump -uuser -ppass --all-databases > /host/machine/path/backup.sql |
| // FILE: __mocks__/reducers.js | |
| /* | |
| * Wrap every function exported in a module with a Jest mock fn, keeping the original implementation. | |
| * Allows for using the fn().mock.xxx properties to test fn usage and i/o while still maintaining the original | |
| * functionality | |
| * | |
| * Originally wrote this to wrap around Redux reducers and action creators in a React project to spy on reducer | |
| * activity while still testing the store's side effects | |
| */ |
| #!/bin/bash | |
| # Derived from | |
| # https://github.com/btford/allthethings | |
| # | |
| # Licensed under WTFPL http://sam.zoy.org/wtfpl/ | |
| # | |
| pur=$(tput setaf 5) # Purple |
| #!/bin/bash | |
| # Sets up a database with a magento2 installation. This assumes you are running from under your httpdocs/<release> location and have www.localhost.com in your /etc/hosts file | |
| # To run type : install_magento2 <dirname> <password> <release> | |
| # password is used for the datbase user and the magento admin password | |
| if [ $# -eq 0 ]; then | |
| echo "No arguments supplied" | |
| echo "Usage: `basename $0` <dirname> <password> <release>" | |
| echo "e.g install_magento2.sh mage2 password 21" | |
| exit 1 |