Skip to content

Instantly share code, notes, and snippets.

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

Benyamin Eskandari ItsBenyaamin

🏠
Working from home
View GitHub Profile
@devalade
devalade / coverflow-animation.tsx
Created October 28, 2024 14:58
Coverflow animation
import { PropsWithChildren, useEffect, useState } from "react";
import { Container } from "~/components/container";
import { ArrowLeft, ArrowRight } from "lucide-react";
import { range } from "~/utils/range";
const IMAGES = [
{
id: 1,
url: "https://images.pexels.com/photos/1366919/pexels-photo-1366919.jpeg",
},
@itshaadi
itshaadi / README.md
Last active January 20, 2021 11:55
GeoIP no-route

Usage

this script will generate routing files for ocserv and iproute2 based on MaxMind's GeoLite2

usage: generate.py [-h] [-i] [-g] [-cc]

optional arguments:
  -h, --help  show this help message and exit
  -i          CSV Dir
@realbardia
realbardia / fc-custom-1.conf
Created March 30, 2020 18:20
Telegram Persian font configs
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="pattern">
<test name="family" qual="any">
<string>sans serif</string>
</test>
<edit mode="assign" binding="same" name="family">
<string>IranSans</string>
</edit>
@MRezaNasirloo
MRezaNasirloo / Ganjeh.kt
Last active October 9, 2021 13:17
Share ViewModels across LifecycleOwners
package com.mrezanasirloo.ganjeh
import android.util.SparseArray
import androidx.activity.ComponentActivity
import androidx.annotation.MainThread
import androidx.fragment.app.Fragment
import androidx.fragment.app.createViewModelLazy
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelLazy
@amrza
amrza / infix.kt
Created November 2, 2018 16:14
fun with infix funs in kotlin
import Foods.*
import Sports.*
import Superpowers.*
enum class Foods { pizza, fesenjoon }
enum class Sports { football, volleyball }
enum class Superpowers { fly, disappear }
data class Person(val name: String)
infix fun Person.like(food: Foods) = println("${name} likes ${food}.")