Skip to content

Instantly share code, notes, and snippets.

View Lalmi-Issam's full-sized avatar

Lalmi Mohammed Issam Lalmi-Issam

  • Annaba, Algeria
View GitHub Profile
@Lalmi-Issam
Lalmi-Issam / NestedScrollableHost
Created November 19, 2024 12:39 — forked from micer/NestedScrollableHost
Fixes issue with nested scrolling elements with the same scroll direction inside ViewPager2. https://issuetracker.google.com/issues/123006042
package com.betvictor.casino.presentation.views
/*
* Copyright 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@Lalmi-Issam
Lalmi-Issam / FragmentHomeschedule.kt
Last active February 11, 2025 14:26
ViewPager2 RTL Horizontal RecyclerView Android Kotlin
package /* TESTED ON ANDROID 12 */
import android.os.Bundle
import android.util.Log
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.MotionEvent
import android.view.View
import android.view.View.LAYOUT_DIRECTION_RTL
import android.view.ViewGroup
@Lalmi-Issam
Lalmi-Issam / aes-cbc-padding.kts
Created September 30, 2024 20:19 — forked from flymrc/aes-cbc-padding.kts
Kotlin AES Encryption and Decryption
// ref: https://www.baeldung.com/java-aes-encryption-decryption
import java.util.*
import javax.crypto.Cipher
import javax.crypto.spec.IvParameterSpec
import javax.crypto.spec.SecretKeySpec
fun decrypt(algorithm: String, cipherText: String, key: SecretKeySpec, iv: IvParameterSpec): String {
val cipher = Cipher.getInstance(algorithm)
@Lalmi-Issam
Lalmi-Issam / cloudflare.sh
Created August 13, 2023 01:30 — forked from Manouchehri/cloudflare.sh
Allow CloudFlare only
# Source:
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
# Avoid racking up billing/attacks
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable.
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP
@Lalmi-Issam
Lalmi-Issam / conf
Last active January 24, 2021 20:50
<VirtualHost *:80>
ServerName www.arab-drama.me
ServerAlias arab-drama.me
#DocumentRoot /var/www/project
RewriteEngine on
##HOW TO SETUP DJANGO WEBSITE ?
01/ Install new ubuntu system 18.04 LTS and use follwing cammands to install GUI.
A) "sudo tasksel install ubuntu-mate-desktop"
B) "sudo service lightdm start"
02/ Create new user with "www-data" and superuser permession:
A) "adduser username"
@Lalmi-Issam
Lalmi-Issam / download_progress
Created September 22, 2019 10:37 — forked from andreyshuster/download_progress
ajax download file with progress bar
var target = "file destination";
// check compartibility
// reset progress bar
$('.progress-bar').css('width', '0%').attr('aria-valuenow', 0);
var xhr=new XMLHttpRequest();
xhr.overrideMimeType('application/octet-stream');
xhr.open('GET', target, true);
xhr.responseType='arraybuffer';
xhr.send();
xhr.onprogress=function(e){
@Lalmi-Issam
Lalmi-Issam / sitenavigation-schema-org
Created June 1, 2019 11:42 — forked from HoussenMoshine/sitenavigation-schema-org
Exemple de la balise SiteNavigation de Schema.org
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "SiteNavigationElement",
"name": [
"Comment activer son compte Paypal à Madagascar ?",
"Utilisez Payoneer pour activer son compte Paypal",
"Demander une carte Payoneer",
"Activer la carte Payoneer",
"Activer votre compte Paypal à Madagascar",
@Lalmi-Issam
Lalmi-Issam / main.py
Created May 8, 2019 20:32 — forked from gear11/main.py
Simple Python proxy server based on Flask and Requests. See: http:/python-proxy-server/gear11.com/2013/12/python-proxy-server/
"""
A simple proxy server. Usage:
http://hostname:port/p/(URL to be proxied, minus protocol)
For example:
http://localhost:8080/p/www.google.com
"""