Skip to content

Instantly share code, notes, and snippets.

View mrsoftware's full-sized avatar
🏠
Working from home

Mohammad Rajabloo mrsoftware

🏠
Working from home
View GitHub Profile
package main
import (
"os"
"os/signal"
"syscall"
)
func main() {
for repo in $(curl "https://gitlab.com/api/v4/projects?private_token=TOKEN&owned=yes" | jq '.[].ssh_url_to_repo' | tr -d '"'); do git clone $repo; done;
// generate react native splash screen
// image must be 2208 2208 and psd format and small logo in center center
yo rn-toolbox:assets --splash splashscreen.psd --android
@mrsoftware
mrsoftware / stype.css
Created November 16, 2022 20:50
some reusable css
:root {
--clr-primery-200: some color;
--ff-primery: "Roboto", sans-serif;
}
*, *::before, *::after {
box-sizing: border-box;
}
body, h1, h2, h3, p {
@mrsoftware
mrsoftware / yandexDirectionMapper.go
Created January 14, 2024 16:00
calculate yandex direction based on lat/lng
type Point struct {
Lat float64
Lng float64
}
func YandexDirectionMapper(old Point, new Point) (float64, float64) {
length := math.Sqrt(math.Pow(new.Lng-old.Lng, 2) + math.Pow(new.Lat-old.Lat, 2))
if length == 0 {
return 0, 0
@mrsoftware
mrsoftware / rust error handling compile time check
Created December 4, 2024 20:40
rust anti-patterns to avoid
#![deny(clippy::unwrap_used)]
#![deny(clippy::expect_used)]
#![deny(clippy::panic)]
#![deny(unused_must_use)]
@mrsoftware
mrsoftware / main.rs
Created August 22, 2025 10:02
custom Serialize for custom rename snum
use serde::{Serialize, Serializer};
#[derive(Clone, Debug, Copy)]
pub enum ComparisonOperators {
EQ(i64),
NEQ(Provider),
}
#[derive(Serialize, Clone, Debug, Copy)]
pub enum Provider {