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/sh | |
open -na "PyCharm.app" --args "$@" | |
# # Notes for PyCharm command-line launcher script: | |
# ## Installation (Ref: https://www.jetbrains.com/help/pycharm/working-with-the-ide-features-from-command-line.html): | |
# Place this file in: /usr/local/bin/pycharm |
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
#!/usr/bin/env python3.7 | |
# Daemon script for iTerm2, to change color preset based on time of day | |
# Simpler than https://iterm2.com/python-api/examples/darknight.html#darknight-example | |
import asyncio | |
import datetime | |
import iterm2 |
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
sudo rm /usr/local/bin/docker* | |
sudo rm /usr/local/bin/hub-tool | |
sudo rm /usr/local/bin/kubectl* | |
sudo rm /usr/local/bin/vpnkit | |
sudo rm /usr/local/bin/com.docker.cli |
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
#!/usr/bin/env bash | |
new_venv_path=/Users/tams/code/django-app-starter/.venv | |
old_venv_path=`tail -1 ./.venv/pyvenv.cfg | cut -d' ' -f6` | |
echo Old venv path is at: $old_venv_path | |
echo Files containing path: | |
for x in `grep -rnw . -e "$old_venv_path" --binary-files=without-match | cut -d: -f1`; | |
do echo $x | |
sed -i "s|$old_venv_path|$new_venv_path|g" $x |
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
// Declare reusable variable | |
let x; | |
// Hide Sidebar | |
document.querySelector('.dark.bg-gray-900').classList.toggle('md:hidden'); | |
// Fix app alignment | |
document.querySelector('.flex.h-full.flex-1').classList.toggle('md:pl-[260px]') |
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
#!/usr/bin/env bash | |
# Install git.plugin.zsh from Oh My Zsh framework (https://github.com/ohmyzsh/ohmyzsh) | |
mkdir -p ~/.config/zsh | |
cd ~/.config/zsh | |
curl -O https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/plugins/git/git.plugin.zsh | |
if ! grep -q 'source ~/.config/zsh/git.plugin.zsh' ~/.zshrc; then | |
echo -e '\n# Load git plugin from Oh My Zsh framework (https://github.com/ohmyzsh/ohmyzsh)' >> ~/.zshrc |
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
#!/usr/bin/env python | |
# Get all js and jsx files in project and print out the situations | |
# in which there is a file named *.js beside an identically-named *.jsx file | |
import subprocess | |
# Get sorted list of paths of all {js,jsx} files in project, excluding node_modules dir | |
command = "find -L . \ |
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
location / { | |
index index.html index.htm; | |
#try_files $uri $uri/ =404; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $remote_addr; | |
proxy_pass http://localhost:3000; |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
#!/usr/bin/env bash | |
# Return a string that's escaped and ready to be used as | |
# the replacement string in a basic regular expression. | |
# Reference: https://unix.stackexchange.com/questions/32907/what-characters-do-i-need-to-escape-when-using-sed-in-a-sh-script/33005#33005 | |
escape_regex_replacement_string() { | |
# Reference: https://github.com/koalaman/shellcheck/wiki/SC2001 | |
string=$1 | |
if [[ $string =~ \\ ]]; then |
NewerOlder