Skip to content

Instantly share code, notes, and snippets.

View hmble's full-sized avatar
🙈
Learning

Samyak Bakliwal hmble

🙈
Learning
View GitHub Profile
@hmble
hmble / postman_installation.md
Created March 19, 2024 05:58 — forked from Akhil-Suresh/postman_installation.md
Installing Postman on Ubuntu/Debian

Installing Postman

Step 1

If any version of postman is installed we need to remove it

sudo rm -rf /opt/Postman

Step 2

@hmble
hmble / index.astro
Created August 19, 2023 13:17
astro with shiki and markdown it
---
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();

a way to query structured json

A structured log file where each line is a valid json string.

Example

{"level": "info", "message": "information message"}
{"level": "warn", "message": "warn message"}
@hmble
hmble / index.html
Created December 16, 2021 11:49
SVG − remove whitespace
<!-- paste svg(s) here -->
@hmble
hmble / unsaver.py
Created December 16, 2021 09:10 — forked from Suleman-Elahi/unsaver.py
Sript to unsave all saved Instagram posts. Uses Instagram private API by ping and its extensions to do the heavy lifting.
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=[]
@hmble
hmble / jestsnippet.json
Created November 26, 2021 12:28
Vscode snippet for jest
{
"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});"
@hmble
hmble / til.txt
Created November 8, 2021 13:03
til
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
@hmble
hmble / clipboardtrack.sh
Last active July 14, 2021 09:31
Track clipboard and save the clipboard content to a file
#!/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
@hmble
hmble / TIL.md
Created July 2, 2021 11:55
create a user and give access to database
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;
const content = document.querySelectorAll('.entry-content > p > a');
content.forEach(e => console.log(e.href))