Skip to content

Instantly share code, notes, and snippets.

View wallismu's full-sized avatar
🦑
🦑🦑🦑

Wallis wallismu

🦑
🦑🦑🦑
View GitHub Profile
# Get all ports
sudo lsof -i -P | grep LISTEN | grep :$PORT
@wallismu
wallismu / convert.py
Last active September 24, 2020 19:40
import os
import sys
import shutil
def convert(which, path):
command = ""
if which == "audio":
command = "ffmpeg -i \"" + path[0:-4] + ".wav\" -acodec libmp3lame \"" + path[0:-4] + ".mp3\" && rm \"" + path[0:-4] + ".wav\""
# if which == "pngs":
# command = "pngquant --force --skip-if-larger --ext .png --speed 1 \"" + path + "\""
from zipfile import ZipFile
import os
os.chdir("./engine")
def get_all_file_paths(rootPath):
file_paths = []
for root, dirs, files in os.walk(rootPath):
for filename in files:
syntax on
set number relativenumber
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
set hlsearch
## Unzips all zips in a directory, puts them into their own
## directories with the same name, then deletes original zip
## Adapted from
## https://unix.stackexchange.com/questions/321683/unzip-all-files-into-directories-with-the-same-name
for d in *.zip
do
dir=./${d%%.zip}
unzip -d "$dir" "$d"
rm "$d"
RED='\033[0;31m'
NC='\033[0m'
printf "${RED}Bash profile loaded /人◕ ‿‿ ◕人\${NC}\n"
alias cd_h="cd /Applications/MAMP/htdocs/"
alias cd_hc="cd /Applications/MAMP/htdocs2"
alias cd_pp="cd /Users/wallis/PycharmProjects/"
alias cd_dd="cd /Users/wallis/Dev/"
alias filecount="find . -type f -print | wc -l"
alias simpleserver="python -m SimpleHTTPServer 8001"