Skip to content

Instantly share code, notes, and snippets.

View chankruze's full-sized avatar
🎯
Focusing

Chandan Kumar Mandal chankruze

🎯
Focusing
View GitHub Profile
import java.util.ArrayList;
import java.util.Scanner;
import java.util.List;
public class StrongNumber {
public static int factorial(int n) {
if (n < 1) return 1;
return n * factorial(n - 1);
}
public static void main(String args[]) {
@chankruze
chankruze / twrp-recovery-flags.mk
Created November 24, 2023 07:30 — forked from zawzaww/twrp-recovery-flags.mk
Makefile Flags for Compiling TWRP
# USEFUL TWRP RECOVERY FLAGS
# by ZawZaw @XDA-Developers
# Thanks to : @xda-developers for helps
# Add EXT4 support
TARGET_USERIMAGES_USE_EXT4 := true
# Disable/enable SELinux. Only suggested when you want to enable SELinux support
TWHAVE_SELINUX := true
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/webhook', methods=['POST'])
def ReturnJSON():
if request.method == 'POST':
data = {"event": "Message Receive",
"messageID": "wamid.HBgMOTE4MTQ0MzU2NzY3FQIAEhggN0MxQUZCNDg2OTc1ODBBMTIxREQ0MDIwMzkyNTRDQ0IA",

fix: /usr/bin/env: ‘bash\r’: No such file or directory

Check your path, echo $PATH. WSL2 normally imports Windows path there. To fix this create file /etc/wsl.conf in WSL2:

[interop]
appendWindowsPath = false

Then restart WSL2 with wsl --shutdown. Then check your path is shorter now and doesn't include any Windows dependencies: echo $PATH

How to turn off Windows Defender in Windows 10/11 permanently

Step 1. Boot into safe mode

Click on Windows Start and search for msconfig. Run System Configuration as administrator.

image

You can also start the program Run. Type msconfig and click on OK.

Using JS, convert:

[ "OR", ["<", "a", "b"], [ "AND", ["==", "c", "d"], ["!=", "e", "f"] ] ]
// To:
a < b OR (c == d AND e != f)
/*
Author: chankruze ([email protected])
Created: Wed Mar 09 2022 10:06:36 GMT+0530 (India Standard Time)
Copyright (c) geekofia 2022 and beyond
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
const rgb2hex = (...args) => {
const hexColour = (c) => {
if (c < 256) return Math.abs(c).toString(16).padStart(2, "0");
return 0;
}
let hex = "#";
args.forEach(val => hex += hexColour(val))
return hex
}
@chankruze
chankruze / urlretrieve.py
Created June 25, 2021 19:33 — forked from xflr6/urlretrieve.py
Replacement for urllib.urlretrieve(url, filename) using the requests library
# urlretrieve.py - implement urllib.urlretrieve(url, filename) with requests
import contextlib
import urllib
import requests
def urlretrieve(url, filename):
with contextlib.closing(requests.get(url, stream=True)) as r:
r.raise_for_status()