Fri 08. December 2023 | 2023-12-08
List processes
Relatert: https://useful-snippets.netlify.app/posts/finne-prog-med-port/
All
sudo netstat -nlp | grep tcp
Sudo gives more info on process id & stuff
One specific port
sudo lsof -i:3000
sudo lsof -i:80
sudo lsof -i:443
sudo lsof -i:4173
Kill process
By name
killall -9 node
sudo killall -9 caddy
related: https://useful-snippets.netlify.app/posts/quit-caddy-process/
sudo killall -9 http-server
By PID
eg: tcp6 0 0 :::3000 :::* LISTEN 1686/node
__________________________________^^______
killall -9 1686
By port
eg: tcp6 0 0 :::3000 :::* LISTEN 1686/node
________________^^________________________
sudo killall $(lsof -t -i:3000)
Eller med
fuser -k 3000/tcp
Fri 08. December 2023 | 2023-12-08
Prøv å kjøre npx prettier filenamepath --write
før du formatterer i webstorm/VSCode
Sun 26. November 2023 | 2023-11-26
View > Appearance > show status bar
View > show status bar widgets > BRANCH
ÅPNE MENY NEDE TIL HØYRE > Velg branch du vil sammenligne med
Sun 26. November 2023 | 2023-11-26
- Sql (S Q L / Sequel / Squeel )
- xampp (Shamp)
- Zsh (Zash)
- C# (See sharp, see hash)
- LaTeX (Lateck)
- Vite (French word for "quick", pronounced /vit/, like "veet")
- Deno ("Dino", ikke "Deno")
- JWTs (JSON Web Token, pronounced 'jot')
- Lua (pronounced LOO-ah)
Sun 26. November 2023 | 2023-11-26
.eslintrc
"prettier/prettier": 0,
nyttig for webstorm
Sat 18. November 2023 | 2023-11-18
Top right drop-down menu:
Edit configurations
python interpreter:
place breakpoint (not in the template, click the left border)
--OK--
Debug 'name' (F5) (At least with VS Code keymap)
Sun 05. November 2023 | 2023-11-05
Eg. Search for "use-query-params" in package.json
's git history
git grep use-query-params $(git rev-list --all -- package.json) -- package.json
Sun 05. November 2023 | 2023-11-05
fetch all related products from a list of products, and get results merged into one response!
const GET_RELATED_PRODUCTS = `
query getRelatedProducts($url: [String!]) {
products(filter: { url: { in: $url } }) {
items {
}
}
}
`
fetching just one product's related products
const GET_RELATED_PRODUCTS = `
query getRelatedProducts($url: String!) {
products(filter: { url: { eq: $url } }) {
items {
}
}
}
`
Sun 29. October 2023 | 2023-10-29
krasjer npm run test-storybook ? Får du error-meldinger som folk på internettet sier betyr at du har gått tom for RAM?
Prøv:
- lukk alle andre programmer
- lukk IDE-en og kjør testen i wsl-terminalen?
- prøv noe av det som blir foreslått her: https://github.com/storybookjs/storybook/issues/12348
Sun 29. October 2023 | 2023-10-29
Hvordan opprette og bruke
Github / Gitlab
Create SSH-keys & upload to Gitlab
Fint for å slippe å skrive inn brukernavn og passord hver eneste gang
ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/paalss/.ssh/id_rsa):
[Enter]
...
Your public key has been saved in /home/paalss/.ssh/id_rsa.pub
...
cat /home/paalss/.ssh/id_rsa.pub
ssh-rsa <Hererenlanghashcode> paalss@Asus-VivoBook
- Gå til SSH-siden:
- Lim inn
ssh-rsa <Hererenlanghashcode>
Resten er rett frem
https://docs.oracle.com/en/cloud/cloud-at-customer/occ-get-started/generate-ssh-key-pair.html
Blir du spurt om username og password (PAT) ved git push
?
Da bruker du sannsynligvis HTTPS:
Slik bytter du til SSH:
git remote set-url origin git@github.com:paalss/<repo>.git
Bitbucket
https://peter-whyte.com/setup-ssh-keys-in-wsl/
eval $(ssh-agent -s) && ssh-add ../pw_bitbucket
Personal Access Token for http
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token
Kan brukes til authentication i stedet for passord
https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
eller:
ssh-add ~/.ssh/github_pw
Sun 29. October 2023 | 2023-10-29
Discovery:
Set position: fixed|avsolute
on parent element, and you can choose between instant and smooth scroll-behaviors (scroll-behavior: initial|smooth
)
But with position: sticky|relative|static
you can't choose. You're stuck with smooth scrolling
Sun 29. October 2023 | 2023-10-29
explorer.exe .