This file contains 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
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
This file contains 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
Play/Pause toggle: | |
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause | |
Previous: | |
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Previous | |
Next: | |
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next |
This file contains 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 bash + venv | |
# bash_prompt | |
# The various escape codes that we can use to color our prompt. | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[1;33m\]" | |
GREEN="\[\033[0;32m\]" | |
BLUE="\[\033[1;34m\]" | |
LIGHT_RED="\[\033[1;31m\]" | |
LIGHT_GREEN="\[\033[1;32m\]" | |
WHITE="\[\033[1;37m\]" |
This file contains 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
#!/bin/bash | |
# This hook should go to $WORKON_HOME/premkvirtualenv | |
typeset repo_name=${1} | |
typeset repo_path="path/to/your/${repo_name}" | |
echo "cd $HOME/$repo_path" >> "$WORKON_HOME/$repo_name/bin/postactivate" | |
echo "if [ \$? -eq 0 ]; then" >> "$WORKON_HOME/$repo_name/bin/postactivate" | |
echo " clear" >> "$WORKON_HOME/$repo_name/bin/postactivate" | |
echo "else" >> "$WORKON_HOME/$repo_name/bin/postactivate" | |
echo " echo \"No directory found. Is the venv name equal to project name?\"" >> "$WORKON_HOME/$repo_name/bin/postactivate" | |
echo "fi" >> "$WORKON_HOME/$repo_name/bin/postactivate" |
This file contains 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
{ | |
"Resources" : { | |
"CFVPC": { | |
"Type": "AWS::EC2::VPC", | |
"Properties": { | |
"CidrBlock": "10.0.0.0/16", | |
"EnableDnsSupport": "true", | |
"EnableDnsHostnames": "true", | |
"InstanceTenancy": "default" | |
} |
This file contains 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
{ | |
"Resources" : { | |
"CFVPC": { | |
"Type": "AWS::EC2::VPC", | |
"Properties": { | |
"CidrBlock": "10.0.0.0/16", | |
"EnableDnsSupport": "true", | |
"EnableDnsHostnames": "true", | |
"InstanceTenancy": "default" | |
} |
This file contains 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
! | |
! Swap Caps_Lock with Shift_L and Shift_L with Ctrl_L. Also swap | |
! pgup with home and pgdown with end. | |
! | |
remove Shift = Shift_L | |
remove Control = Control_L | |
remove Lock = Caps_Lock | |
keycode 66 = Shift_L | |
keycode 50 = Control_L | |
keycode 110 = Prior |