Skip to content

Instantly share code, notes, and snippets.

View Bmohsen's full-sized avatar
🌏
Working from home

Mohsen Bmohsen

🌏
Working from home
  • World
  • Shiraz, Iran
  • 04:43 (UTC +03:30)
View GitHub Profile
@Bmohsen
Bmohsen / traefik-compose.yml
Last active March 31, 2024 23:08
Traefik Compose file with http to https redirect enabled for all the routes for docker Swarm
version: "3.9"
services:
traefik:
# Use the latest v3.0.x Traefik image available
image: traefik:v3.0
ports:
# Listen on port 80, default for HTTP, necessary to redirect to HTTPS
- target: 80
published: 80
@Bmohsen
Bmohsen / unicon_downloader.py
Created December 5, 2022 21:19
download all unicon(line version) font icon with python
import requests
def download_fonts():
base_url = 'https://unicons.iconscout.com/release/v4.0.0/fonts/line/'
file_formats = ['eot', 'woff', 'ttf', 'woff2', 'svg']
for i in range(21):
for ext in file_formats:
file_name = f'unicons-{i}.{ext}'
print(f'downloading {file_name} ...')
@Bmohsen
Bmohsen / 2dArray.js
Created September 11, 2022 07:37
2d array JavaScript function
function make2DArray(cols, rows){
let arr = new Array(cols)
for(let i = 0; i < arr.length; i++){
arr[i] = new Array(rows)
}
return arr
}