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 / main.py
Last active May 9, 2025 05:27
Bot Untuk Seatalk
# Reverse proxy untuk app script agar tidak mendapatkan response redirect
from flask import Flask, request, Response
import requests
app = Flask(__name__)
@app.route('/', methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"])
def hello_world():
@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 — forked from devomman/activate-office-windows-mac.md
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 / HttpClient.java
Last active April 19, 2024 14:14
Traditional android using java to perform http task
import android.content.Context;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
@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
#!/bin/bash
echo -e "# Don't add passphrase"
ssh-keygen -t rsa -b 4096 -m PEM -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 / 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