This file contains hidden or 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
:filetype indent on | |
:set filetype=html | |
:set smartindent | |
gg=G |
This file contains hidden or 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
# change permissions on the key file (read) | |
chmod 400 <key.pem> | |
# ssh into the ec2 container | |
ssh -i "<key.pem>" uname@<ec2-address/ip-address> | |
# upgrade & update apt package manager (Debian/Ubuntu) | |
sudo apt update && apt upgrade | |
# check & update yum package manager (CentOS/RHEL) |
This file contains hidden or 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
function updateSize() { | |
var projectTile = document.querySelectorAll("#projects .tile.is-child"); | |
projectTile.forEach( function(tile, index) { | |
if (window.innerWidth > 768) { | |
tile.style.height = getComputedStyle(tile).width; | |
} else { | |
tile.style.height = null; | |
} | |
}) | |
} |
This file contains hidden or 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
// vim: syntax=sql | |
-- many-to-many relationship needs join table | |
CREATE TABLE IF NOT EXISTS student_course ( | |
student_id INTEGER, | |
course_id INTEGER, | |
PRIMARY KEY (student_id, course_id), | |
FOREIGN KEY (student_id) REFERENCES student (id), | |
FOREIGN KEY (course_id) REFERENCES course (id) ); |
This file contains hidden or 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
# list profile paths loading variables | |
sudo bash -c "echo exit|dtruss bash -li|& less|grep '^open'" | |
# .bash_profile is for login shell, whereas .bashrc is for non-login shell (SSH) |
This file contains hidden or 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
// vim: syntax=go | |
// ***** 3 PERIODS (ELLIPSIS) UNPACK A VARIABLE ***** | |
primes := []int{2, 3, 5, 7} | |
fmt.Println(Sum(primes...)) // 17 | |
// ***** JSON STRUCTS ***** | |
// A field with a json: struct tag is stored with its tag name instead of its variable name. | |
type user struct { |
This file contains hidden or 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
// vim: syntax=sql | |
CREATE OR REPLACE FUNCTION create_constraint_if_not_exists (t_name text, c_name text, constraint_sql text) | |
RETURNS void | |
AS | |
$BODY$ | |
BEGIN | |
-- Look for our constraint | |
IF NOT EXISTS (SELECT constraint_name | |
FROM information_schema.constraint_column_usage |
This file contains hidden or 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 | |
# https://github.com/estysdesu/dotFiles/blob/master/bin/lapHeater | |
warning=90 | |
bad=120 | |
nc='\033[0m' # no color | |
red='\033[0;31m' | |
yellow='\033[0;33m' | |
green='\033[0;32m' |
This file contains hidden or 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` may not point to bash; setting `SHELL:=$(shell which bash)` ensures brace expansion (bashism) will work | |
SHELL:=$(shell which bash) | |
DIR_:=$(shell pwd) | |
.PHONY: clean | |
clean: | |
@bash -c "rm -rf $(DIR_)/{.vscode,venv,__pycache__}" |
OlderNewer