Skip to content

Instantly share code, notes, and snippets.

View moh-affan's full-sized avatar
💭
🥰💻

Moh. Affan moh-affan

💭
🥰💻
View GitHub Profile
@moh-affan
moh-affan / README.md
Created August 25, 2025 08:39 — forked from ppoffice/README.md
Install Visual Studio Code (actually code-server) on Android
  1. Install Termux, an Android terminal emulator that provides a Linux execution environment and various tools.

  2. Update system packages in Termux:

    $ pkg update -y
@moh-affan
moh-affan / timed_cache.py
Created September 3, 2024 00:29 — forked from Morreski/timed_cache.py
Python lru_cache with timeout
from datetime import datetime, timedelta
import functools
def timed_cache(**timedelta_kwargs):
def _wrapper(f):
update_delta = timedelta(**timedelta_kwargs)
next_update = datetime.utcnow() + update_delta
# Apply @lru_cache to f with no cache size limit
@moh-affan
moh-affan / office-activation.md
Created September 1, 2024 08:08
Office Activation Command by Omman

Office 2021

Method 1: Using my command line

Step 1.1: Open cmd program with administrator rights.

  • First, you need to open cmd in the admin mode, then run all commands below one by one.

Step 1.2: Get into the Office directory in cmd.

  • For x86 and x64
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
cd /d %ProgramFiles%\Microsoft Office\Office16
@moh-affan
moh-affan / Cash register
Created May 10, 2023 09:14 — forked from Shaikot007/Cash register
Cash register. (freeCodeCamp JavaScript algorithms and data structures challenge)
function checkCashRegister(price, cash, cid) {
var change = cash - price;
var coinValues = [
{ name: 'ONE HUNDRED', val: 100.00 },
{ name: 'TWENTY', val: 20.00 },
{ name: 'TEN', val: 10.00 },
{ name: 'FIVE', val: 5.00 },
{ name: 'ONE', val: 1.00 },
{ name: 'QUARTER', val: 0.25 },
@moh-affan
moh-affan / .gitignore
Created May 2, 2023 12:12 — forked from mermshaus/.gitignore
PHP source code obfuscator
obfuscate
@moh-affan
moh-affan / jwtRS512.sh
Created March 1, 2023 10:43 — forked from azanium/jwtRS512.sh
How to generate JWT RS512 key
ssh-keygen -t rsa -b 4096 -e SHA512 -f jwtRS512.key
# Don't add passphrase
openssl rsa -in jwtRS512.key -pubout -outform PEM -out jwtRS512.key.pub
cat jwtRS512.key
cat jwtRS512.key.pub
@moh-affan
moh-affan / README.md
Created December 30, 2022 07:00 — forked from nyancodeid/README.md
Make RESTful API with Google Apps Script and SpreadSheet

Google Script CRUD

By Ryan Aunur Rassyid

Simply create RESTful API with Google Script and store it to Google SpreadSheet like a Pro.

@moh-affan
moh-affan / install-wkhtmltopdf.sh
Created December 7, 2022 11:29 — forked from yajra/install-wkhtmltopdf.sh
Install wkhtmltopdf 0.12.4 (with patched qt)
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz
mv wkhtmltox/bin/wkhtmlto* /usr/bin/
ln -nfs /usr/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
@moh-affan
moh-affan / fuzzy_logic.py
Created November 29, 2021 22:33 — forked from ryangmolina/fuzzy_logic.py
A simple python implementation of Mamdani Fuzzy Logic
def trimf(x, points):
pointA = points[0]
pointB = points[1]
pointC = points[2]
slopeAB = getSlope(pointA, 0, pointB, 1)
slopeBC = getSlope(pointB, 1, pointC, 0)
result = 0
if x >= pointA and x <= pointB:
result = slopeAB * x + getYIntercept(pointA, 0, pointB, 1)
elif x >= pointB and x <= pointC:
@moh-affan
moh-affan / main.dart
Created November 21, 2021 00:39 — forked from jogboms/main.dart
Light Gradient Knob
import 'dart:math' as math;
import 'dart:ui';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart';
void main() => runApp(
MaterialApp(