Skip to content

Instantly share code, notes, and snippets.

View arshamalh's full-sized avatar
:octocat:
This Octacat is my pet!

Mohammad Reza Karimi arshamalh

:octocat:
This Octacat is my pet!
View GitHub Profile
@arshamalh
arshamalh / session_based_ticker.go
Last active July 26, 2025 05:23
Session Based Ticker
package main
import (
"fmt"
"time"
)
type SessionBasedTicker struct {
start time.Time
end time.Time
@ayoubzulfiqar
ayoubzulfiqar / folder_structure.md
Created September 5, 2023 06:12
The Folder Structure for Every Golang Project

Go - The Ultimate Folder Structure

Organizing your Go (Golang) project's folder structure can help improve code readability, maintainability, and scalability. While there is no one-size-fits-all structure, here's a common folder structure for a Go project:

project-root/
    ├── cmd/
    │   ├── your-app-name/
    │   │   ├── main.go         # Application entry point
    │   │   └── ...             # Other application-specific files
@siamakrostami
siamakrostami / VideoRecorderHelper.swift
Last active March 5, 2023 06:52
Video Recorder + Liveness Detection
import AVFoundation
import AVKit
import Combine
import Foundation
// MARK: - VideoRecorderHelper
class VideoRecorderHelper: NSObject {
// MARK: Lifecycle
@mahmoud-eskandari
mahmoud-eskandari / README.md
Last active June 29, 2025 23:45
Install v2ray on Bridge:(Ubuntu +18 via systemd) - Upstream (Ubuntu +18/CentOS +7 via docker)

پنل x-ui

پنل تحت وب مدیریت V2ray و ساخت کاربر و مدیریت سرور

mkdir x-ui && cd x-ui
docker run -itd --network=host \
    -v $PWD/db/:/etc/x-ui/ \
 -v $PWD/cert/:/root/cert/ \
@arshamalh
arshamalh / jwt_interval.go
Created June 10, 2022 21:57
Golang JWT and intervals (using goroutines and channels)
package main
import (
"fmt"
"time"
"github.com/golang-jwt/jwt"
)
func main() {
@bradtraversy
bradtraversy / laravel_valet_setup.md
Last active September 16, 2025 07:22
Laravel Valet install on mac

Laravel Valet Setup (Mac)

This will get you setup with Laravel & Valet on your Mac. Quentin Watt has a good video tutorial on getting setup here as well

Install Homebrew

Go to https://brew.sh/ and copy the command and run in your terminal

It will be something like this...

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@arshamalh
arshamalh / calculator_api_server.go
Created March 5, 2022 20:04
Simple calculator API server in Golang
package main
import (
"encoding/json"
"fmt"
"math"
"net/http"
// go get "github.com/gorilla/mux"
"github.com/gorilla/mux"
)
@arshamalh
arshamalh / making_json_with_maps.go
Created March 5, 2022 00:13
Reading and writing JSON objects in Golang
package main
import (
"encoding/json"
"fmt"
)
func main() {
myJson := map[string]interface{}{
"name": "Arsham",
@arshamalh
arshamalh / pymongo_assistant_01.py
Last active March 23, 2022 11:04
Pymongo Assistant
"""
Written by Arsham Arya
Some snippets around pymongo package to prevent my confusion.
"""
from pymongo import MongoClient
# Initializing
client = MongoClient("mongodb://username:password@host:port/default_db?authSource=admin")
database = client.get_database("db_name")
collection = database.get_collection("collection_name")
@arshamalh
arshamalh / 1_running_scrapy_from_anothor_python_file.py
Last active February 7, 2022 13:58
Running Scrapy spider along fastAPI or APScheduler, from another script or main.py.
from scrapy import crawler
from scrapy.utils.project import get_project_settings
# pip install crochet
from crochet import setup as crochet_setup, run_in_reactor
crochet_setup()
runner = crawler.CrawlerRunner(get_project_settings())
@run_in_reactor