Skip to content

Instantly share code, notes, and snippets.

View Bloody-Badboy's full-sized avatar
😪
Wake me up when we can travel again

Arpan Sarkar Bloody-Badboy

😪
Wake me up when we can travel again
View GitHub Profile
@Bloody-Badboy
Bloody-Badboy / L3250_Reset.py
Created July 25, 2023 13:09
EPSON L3250 Series Waste Ink Counter Reset Using SNMP Protocol (Remove Service Required)
import re
from easysnmp import Session
from pprint import pprint
from struct import pack, unpack
printer_ip = "10.0.0.222"
session = Session(hostname=printer_ip, community="public", version=1, timeout=1)
password = [74, 54]
@Bloody-Badboy
Bloody-Badboy / spot_welder.ino
Created February 7, 2024 17:06
Revived my cheap 12V Battery Storage Spot Welding Machine's dead MCU using Arduino Pro Mini https://imgur.com/a/Gro65kt
// https://imgur.com/a/Gro65kt
#define DEBUG 1
#if DEBUG == 1
#define log(s) Serial.print(s)
#define logln(s) Serial.println(s)
#else
#define log(s)
#define logln(s)
// Copyright 2022 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
(function () {
"use strict";
if (window.Solver) {
return;
}
var Solver = (window.Solver = {});
Solver.LEFT = 37;
@Bloody-Badboy
Bloody-Badboy / BytesSearchUtils.java
Created January 30, 2018 15:32
A utility class to search for certain byte pattern in any file or in bytes array
/*
* Copyright (C) 2015 BloodyBadboyCreation, Inc. (Arpan Bloody Badboy)
*
* 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
*
* Unless required by applicable law or agreed to in writing, software
@Bloody-Badboy
Bloody-Badboy / index.html
Created July 19, 2023 15:13
launch app from web page 🔥 🚀
<!DOCTYPE html>
<html>
<head>
<meta name="deepview-service" content="deepview-service" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<script type="text/javascript">
let timeoutToDownload = 0;
package dev.arpan.ui.widget
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.RectF
import android.os.Parcel
import android.os.Parcelable
import android.util.AttributeSet
package com.traveller
import com.google.android.material.shape.EdgeTreatment
import com.google.android.material.shape.ShapePath
class NotchEdgeTreatment(private val notchRadius: Float) : EdgeTreatment() {
override fun getEdgePath(
length: Float,
center: Float,
interpolation: Float,
@Bloody-Badboy
Bloody-Badboy / BaseFragment.kt
Last active January 3, 2023 18:09
Inflate ViewBinding using reflection
package dev.arpan.ui.base
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.viewbinding.ViewBinding
import dev.arpan.ui.utils.inflateBinding
@Bloody-Badboy
Bloody-Badboy / DoubleCheckedSingletonTemplate.java
Last active December 8, 2022 07:05
A Better Singleton template for Intellij IDEA/ Android Studio. To add go to Settings > Editor > File and Code Templates > Hit Create Template and add this one
#if (${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
#if (${IMPORT_BLOCK} != "")${IMPORT_BLOCK}
#end
#parse("File Header.java")
#if (${VISIBILITY} == "PUBLIC")public #end class ${NAME} #if (${SUPERCLASS} != "")extends ${SUPERCLASS} #end #if (${INTERFACES} != "")implements ${INTERFACES} #end {
private static volatile ${NAME} sInstance = null;
private ${NAME}() {
if (sInstance != null) {