Skip to content

Instantly share code, notes, and snippets.

View izelnakri's full-sized avatar
🇺🇦
Ember.js is the best.

Izel Nakri | izelnakri.eth izelnakri

🇺🇦
Ember.js is the best.
View GitHub Profile
@izelnakri
izelnakri / bitbox-bridge.nix
Last active March 10, 2025 09:32
flake.nix - Most universal template for any software project
# Example of a binary packaging(storing a frozen binary with deps WITH compiler build) in nix:
# $ nix run --impure --expr 'let pkgs = import <nixpkgs> {}; in pkgs.callPackage ./bitbox-bridge.nix {}'
{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
pkg-config,
libudev-zero,
}:
@izelnakri
izelnakri / pcall.js
Last active February 26, 2025 01:56
Pcall.js Lua pcall in JavaScript
async function exampleFunc(greeter?: string, another): Promise<string> {
if (!greeter) {
throw new Error('Somethinggg', another);
}
return `Hello, ${greeter} ${another}`;
}
let pcall = (func: Promise<Any> | Function, ...otherArguments: any) => {
if (func instanceof Promise) {
@izelnakri
izelnakri / AndroidActions.txt
Last active February 6, 2025 21:20 — forked from zr0n/AndroidActions.txt
List of Android Actions
/** Find all Activity of an app **/
adb shell dumpsys package | grep -i "package.name" | grep Activity
/** Service Actions **/
android.app.action.DEVICE_ADMIN_SERVICE
android.intent.action.RESOLVE_INSTANT_APP_PACKAGE
android.intent.action.RESPOND_VIA_MESSAGE
android.intent.action.TTS_SERVICE
android.media.browse.MediaBrowserService
@izelnakri
izelnakri / keyboard.sh
Last active November 16, 2024 22:48
How to share laptop keyboard and trackpad with the VR headset
#!/bin/bash
DEVICE_IDENTIFIER="adb-RFCW7028MXJ-JZpS3e" # Phone
# DEVICE_IDENTIFIER="adb-2G0YC5ZG2001JS" # VR headset
FALLBACK_HOSTNAME="Android.local"
FOUND_DEVICE=$(avahi-browse --all --resolve --terminate -p | grep 'IPv4' | grep "$DEVICE_IDENTIFIER" | grep '=;')
echo "DEVICE IS:"
@izelnakri
izelnakri / AdbCommands
Last active November 25, 2024 10:54 — forked from Pulimet/AdbCommands
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
Current viewed activity:
@izelnakri
izelnakri / attempt.js
Last active October 10, 2024 02:13
JS version of lua pcall, xpcall and attemp
let pcall = (func: Promise<Any> | Function, ...args) => {
if (func instanceof Promise) {
return new Promise(async (resolve) => {
let error
try {
return resolve([true, await promise])
} catch (err) {
error = err
}
@izelnakri
izelnakri / nixos-x1.rst
Created August 27, 2023 17:27 — forked from akaihola/nixos-x1.rst
Installing NixOS on a Lenovo ThinkPad Carbon X1 Gen 9
@izelnakri
izelnakri / http-server.js
Created July 6, 2023 19:22
No-dependency HTTP Server in node.js
import fs from "node:fs";
import http from "node:http";
import path from "node:path";
import process from "node:process";
const PORT = 8000;
const STATIC_PATH = path.join(process.cwd(), "./static");
const NOT_FOUND_HTML_PATH = path.join(STATIC_PATH, "./404.html");
const MIDDLEWARE_HANDLER = async (req, res) => {
@izelnakri
izelnakri / dear-recruiter.js
Last active September 8, 2022 15:40
Running this as a local cronjob with 1h intervals
import process from "process";
import chrome from 'chrome-cookies-secure';
import Puppeteer from "puppeteer";
const HOURLY_RATE = process.env.HOURLY_RATE || 320;
const DEBUG = process.env.DEBUG;
const CHROME_PROFILE = 'Profile 2'; // Change this to your chrome profile
const DEFAULT_TIMEOUT = 3000;
const BROWSER_HEIGHT = 800;