Skip to content

Instantly share code, notes, and snippets.

View Rahmanism's full-sized avatar
💻
I'm coding!

Rahmani Rahmanism

💻
I'm coding!
View GitHub Profile
@Rahmanism
Rahmanism / install-whl-package.sh
Created January 7, 2023 09:15
To install whl python packages
pip install package_name.whl
# https://stackoverflow.com/a/64450982/3144631
@Rahmanism
Rahmanism / guid.ps1
Created January 17, 2023 20:17
Create GUID code in Powershell
[guid]::NewGuid()
@Rahmanism
Rahmanism / media-orientation.css
Created January 21, 2023 09:42
Orientation in CSS media query
@media (orientation: landscape) {
/* some css code */
}
@Rahmanism
Rahmanism / vscode-indentation-active.json
Created January 21, 2023 09:43
To change indentation vertical line color in VSCode, set this in json settings
"workbench.colorCustomizations":{
"editorIndentGuide.activeBackground":"#06a"
}
@Rahmanism
Rahmanism / promise-allsettled.js
Created January 21, 2023 09:46
Using Promise.allSettled instead of Promise.all for concurrency in JavaScript
async function getData() {
const results = await Promise.allSettled({
fetchUser(),
fetchProduct()
})
const [user, product] = handle(results)
}
@Rahmanism
Rahmanism / currency-fetch.html
Created January 22, 2023 07:23
A sample code to use fetch in JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Currency</title>
</head>
@Rahmanism
Rahmanism / html-custom-element.html
Created January 29, 2023 07:45
HTML Custom elements
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Element</title>
<style>
h3 {
@Rahmanism
Rahmanism / html-expandable-list.html
Created January 29, 2023 07:47
HTML Expandable UL - Custom element
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Custom Element - Expandable List</title>
</head>
@Rahmanism
Rahmanism / extract-srt.sh
Created February 18, 2023 15:59
Extract subtitle from a movie using `ffmpeg`
ffmpeg -i movie.mkv -map 0:s:0 sub.srt
@Rahmanism
Rahmanism / upload.py
Last active April 17, 2023 06:33
Upload file Python CGI
import os, cgi, shutil
from sys import exit
print('Content-Type: text/html')
print('')
print('<html><body>')
# Define the HTML form to upload the file
form = cgi.FieldStorage()