Skip to content

Instantly share code, notes, and snippets.

View rezazarchi's full-sized avatar

Reza Zarchi rezazarchi

View GitHub Profile
@rezazarchi
rezazarchi / sendTelegramGroupRules.js
Last active March 12, 2025 11:40
Telegram Bot for showing rules to new members in supergroup
/**
* Telegram Bot for showing rules to new members in a Supergroup
* The bot can be hosted on Cloudflare Workers
* This bot automatically sends a welcome message with group rules when a new user joins the supergroup.
* - The welcome message includes an "Accept" button.
* - Only the mentioned user can click the button to accept the rules.
* - When accepted, the bot deletes the welcome message to keep the chat clean.
* - If another user clicks the button, they receive an alert message.
*
* The bot is deployed on Cloudflare Workers and listens for updates via Telegram Webhook.
@behnamonline
behnamonline / worker.js
Created January 25, 2025 07:22
force join telegram bot
// ozv ejbari telegram bot
/*
https://www.instagram.com/behnamonline
https://www.youtube.com/@behnamonline
https://t.me/behnamonline99
https://www.aparat.com/behnam.online
*/
/*
@codingwithsaeed
codingwithsaeed / purge-build.sh
Created June 18, 2019 04:54
Bash script for cleaning '.gradle' and 'build' folders in android workspace
#! /bin/bash
clear
echo -e "\nHello ;) \nLets purge all '.gradle' and 'build' directories.\n"
for directory in */ ; do
cd $directory
echo "cleaning in $directory"
if [ -d .gradle ];then
rm -rf .gradle
fi
if [ -d app ];then
@Diederikjh
Diederikjh / Cryptography.java
Last active May 24, 2024 04:08
Single class that handles encryption and decryption with keys using the Android `Keystore` API. Mostly inspired by this [blog post](https://medium.com/@ericfu/securely-storing-secrets-in-an-android-application-501f030ae5a3). This was tested with API 18 and 25 level emulator (and a level 23 device).
package com.example.yourapp;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.security.KeyPairGeneratorSpec;
import android.security.keystore.KeyGenParameterSpec;
import android.security.keystore.KeyProperties;
import android.support.annotation.RequiresApi;