Skip to content

Instantly share code, notes, and snippets.

View archiewald's full-sized avatar
🍅

Artur Kozubek archiewald

🍅
View GitHub Profile
@archiewald
archiewald / notes.md
Last active October 26, 2020 07:52
SQL cheatsheet

Outcomes from https://sqlbolt.com/, a great sql mini-course with playground in browser.

Database normalization

is a database design technique that reduces data redundancy and eliminates undesirable characteristics like Insertion, Update and Deletion Anomalies. Normalization rules divides larger tables into smaller tables and links them using relationships. The purpose of Normalization in SQL is to eliminate redundant (repetitive) data and ensure data is stored logically.

moar on https://www.guru99.com/database-normalization.html

-- complete sql query
@archiewald
archiewald / snippet.md
Created October 4, 2020 18:08
#git [git pull --rebase]

More precisely, git pull runs git fetch with the given parameters and calls git merge to merge the retrieved branch heads into the current branch. With --rebase, it runs git rebase instead of git merge.

rebasing

If you pull remote changes with the flag --rebase, then your local changes are reapplied on top of the remote changes.

git pull --rebase

merging

If you pull remote changes with the flag --merge, which is also the default, then your local changes are merged with the remote changes. This results in a merge commit that points to the latest local commit and the latest remote commit.

git pull --merge

@archiewald
archiewald / snippet.git
Last active April 22, 2020 13:32
auth github on windows
AzureAD+ArturKozubek@vostro MINGW64 ~/.ssh
eval `ssh-agent -s`
Agent pid 3705
ssh-add ~/.ssh/id_rsa_github
@archiewald
archiewald / snippet.sh
Last active March 25, 2020 18:13
Deploy subdirectory to heorku
git subtree push --prefix server heroku master
git push heroku `git subtree split --prefix server master`:master --force
@archiewald
archiewald / snippet.sh
Created March 24, 2020 17:30
kill proces on Windows
netstat -ano | findstr :8001
tskill typeyourPIDhere
@archiewald
archiewald / snippet.sh
Last active April 1, 2020 07:37
ngrok #ardent
~/projects/ngrok http 8002 -host-header="localhost:8002"
@archiewald
archiewald / snippet.sh
Created February 24, 2020 09:54
check globally installed packages #node
npm list -g --depth 0
@archiewald
archiewald / snippet.js
Created November 27, 2019 15:16
[sleep with async/await]
await (() => new Promise(resolve => setTimeout(resolve, 1000)))();
@archiewald
archiewald / snippet.sh
Created October 28, 2019 12:03
Start mongo
`sudo service mongod start`
@archiewald
archiewald / about.md
Created October 17, 2019 10:18
git stash by name

git stash push -m "message"

where "message" is your note for that stash.

In order to retrieve the stash you can use: git stash list. This will output a list like this, for example:

stash@{0}: On develop: perf-spike
stash@{1}: On develop: node v10