Skip to content

Instantly share code, notes, and snippets.

View tobihans's full-sized avatar
🙃
Keep it Super Simple !

Hans Bignon K. Tognon tobihans

🙃
Keep it Super Simple !
View GitHub Profile
@tobihans
tobihans / Restore the GRUB Bootloader.md
Created September 21, 2024 19:30 — forked from dianjuar/Restore the GRUB Bootloader.md
Restore the GRUB Bootloader on Manjaro Linux. Usefull when your fresh windows install eats your grub and can not boot into your linux installation, or for some how your grub is missing

Restore the GRUB Bootloader on Manjaro

  1. Chroot into your linux instalation
    1. The easiest way is with mhwd-chroot
      1. Install it yaourt -S mhwd-chroot
      2. Run it sudo mhwd-chroot
      3. DONE, you have chrooted into your linux installation (open a root console of your installed linux OS, is like just open a console with root access)
  2. Restore your GRUB
    1. Install a new GRUB bootloader with grub-install /dev/sda
  3. Recheck to ensure the that installation has completed without any errors grub-install --recheck /dev/sda
@tobihans
tobihans / simple-react-recorder.jsx
Created August 30, 2024 18:55 — forked from cassidoo/simple-react-recorder.jsx
A simple React microphone component, recording audio and showing the blob in the browser, styled with Tailwind.
"use client";
import { useState, useEffect, useRef } from "react";
function SimpleRecordButton() {
const [isRecording, setIsRecording] = useState(false);
const [audioStream, setAudioStream] = useState(null);
const [mediaRecorder, setMediaRecorder] = useState(null);
const [audioBlob, setAudioBlob] = useState(null);
const [recordingTime, setRecordingTime] = useState(0);
const timerRef = useRef(null);
@tobihans
tobihans / ffmpeg-to-480p.sh
Created August 29, 2024 15:50 — forked from blacklee/ffmpeg-to-480p.sh
ffmpeg convert video to 480p
ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4
@tobihans
tobihans / uuidv4test.js
Created July 23, 2024 12:21 — forked from johnelliott/uuidv4test.js
uuid v4 regex
import { v4 as uuid } from 'uuid';
export function generateId() {
return uuid();
}
const v4 = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);
console.log(generateId().match(v4));
//console.log(generateId().length)
@tobihans
tobihans / tailwind-palettte-app.json
Created January 3, 2024 23:13 — forked from michaelroper/tailwind-palettte-app.json
Tailwind CSS default colors in Palettte.app's JSON format
[
{
"paletteName": "gray",
"swatches": [
{
"name": "100",
"color": "#f7fafc"
},
{
"name": "200",
@tobihans
tobihans / README.md
Created December 6, 2023 06:46 — forked from jhass/README.md
Proxy to remote server with CORS support

cors.py for mitmproxy

Hacking CORS restriction to enable in-browser XHR to any server.

Usage

Say you are running an web app at localhost, and you want to send XHR to http://remote-server:80, but the CORS restriction forbids access because you are sending requests from an origin that remote-server:80 does not allow.

Run:

@tobihans
tobihans / git lol.md
Created November 17, 2023 10:11 — forked from Omerr/git lol.md
git lol - an alias to Git that shows the commit graph in a pretty format

log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit

To configure as an alias git lol:

git config --global alias.lol "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset' --abbrev-commit"

@tobihans
tobihans / scorecard.md
Created October 27, 2023 08:54 — forked from lalitsanagavarapu/scorecard.md
Apache Fineract / Mifos - Loan Scorecard Assessment

Organization : Apache Software Foundation / Mifos

Project Name : Credit Scorecard for Loan Assessment

Student : Lalit Mohan Sanagavarapu

Mentors : Avik Ganguly, Nayan Ambali and Mark Reynolds

Project Description :

The project involves literature gathering on methods for credit scoring and early warning of Loans. Literature on Rule based, Statistical and machine learning approaches were reviewed. An exhaustive feature list (credit scoring) is prepared based on the available public datasets, literature and interaction with central and public sector banks. As part of the scope, the UI prototype and DB scripts are also prepared.
@tobihans
tobihans / update-neovim-nightly.sh
Created October 2, 2023 22:26 — forked from ecosse3/update-neovim-nightly.sh
Update Neovim Nightly from latest github release
#!/bin/bash
# Colors definitions
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
BOLD=$(tput bold)
NORMAL=$(tput sgr0)
# Check if necessary applications are installed
@tobihans
tobihans / android-adb-pull-apk.md
Created October 2, 2023 22:21 — forked from ctrl-freak/android-adb-pull-apk.md
Retrieve APK from Non-Rooted Android Device through ADB

https://stackoverflow.com/a/18003462/348146

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.