sudo -u postgres psql
postgres=# create database mydb;
postgres=# create user myuser with encrypted password 'mypass';
postgres=# grant all privileges on database mydb to myuser;
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
| for file in ./*.jpg; | |
| do | |
| echo "$file"; | |
| identify -verbose "$file" | grep Interlace; | |
| done |
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
| const content = document.querySelectorAll('.entry-content > p > a'); | |
| content.forEach(e => console.log(e.href)) |
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 | |
| # Change file location to your preferred path | |
| filelocation="$HOME/Notes/bookamarks.txt" | |
| # Thanks to https://stackoverflow.com/a/3184819 | |
| regex='^(https?|ftp|file)://[-A-Za-z0-9\+&@#/%?=~_|!:,.;]*[-A-Za-z0-9\+&@#/%=~_|]$' | |
| while clipnotify; do | |
| text=$(xclip -o) | |
| if [[ $(xclip -o) ]];then |
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
| ccd: Change current directory to subfolders | |
| cd (fd --type d . | fzf) | |
| Batch rename files in fish | |
| for file in *.md | |
| mv -v -- "$file" (basename $file .md).txt | |
| end |
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
| { | |
| "Jest test component": { | |
| "scope": "typescriptreact", | |
| "prefix": "sdt", | |
| "body": [ | |
| "import {render, act} from \"@/tests/testUtil\";\nimport userEvent from \"@testing-library/user-event\"; \n\n", | |
| "describe(\"${TM_FILENAME_BASE/(.test)//}\", () => {", | |
| "\t test(\"$1\", () => {", | |
| "\t\t$2});", | |
| "\t});" |
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
| from instagram_private_api import Client, ClientCompatPatch | |
| from instagram_private_api_extensions import pagination | |
| import json, time | |
| user_name = 'UserName' | |
| password = 'PassWord' | |
| api = Client(user_name, password) | |
| items=[] |
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
| <!-- paste svg(s) here --> |
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
| --- | |
| import Header from "../components/Header.astro"; | |
| import BaseHead from "../components/BaseHead.astro"; | |
| import { SITE_TITLE, SITE_DESCRIPTION } from '../consts'; | |
| import markdownIt from 'markdown-it'; | |
| import shiki from 'shiki' | |
| const response = await fetch('https://raw.githubusercontent.com/shikijs/shiki/main/README.md'); | |
| // const response = await fetch('https://raw.githubusercontent.com/wiki/adam-p/markdown-here/Markdown-Cheatsheet.md'); | |
| const markdownResponse = await response.text(); |