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 / 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,
@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 / 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;
(function () {
"use strict";
if (window.Solver) {
return;
}
var Solver = (window.Solver = {});
Solver.LEFT = 37;
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 / ApiResult.kt
Last active November 24, 2022 13:08
A wrapper for retrofit which wraps response in ApiResult for easier error handeling check Demo.kt for usages
sealed class ApiResult<out T> {
data class Success<out T>(val value: T) : ApiResult<T>()
data class GenericError(val throwable: Throwable? = null) : ApiResult<Nothing>()
object NetworkError : ApiResult<Nothing>()
override fun toString(): String {
return when (this) {
is Success<*> -> "Success[status=$value]"
is GenericError -> "GenericError[error=${throwable?.message}]"
NetworkError -> "NetworkError"
@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 / ColorParser.java
Created September 14, 2022 05:55
Convert color string to argb values #fff -> [255,255,255,255] , #abcdef -> [255,171,205,239]
package dev.arpan;
public class ColorParser {
public static void main(String[] args) {
printColor(parseColorToARGB("#fff"));
printColor(parseColorToARGB("#abc"));
printColor(parseColorToARGB("#000"));
printColor(parseColorToARGB("#ddd"));
printColor(parseColorToARGB("#abcdef"));
printColor(parseColorToARGB("#50dddddd"));