Skip to content

Instantly share code, notes, and snippets.

View kn007's full-sized avatar
:octocat:
I may be slow to respond.

Karl Chen kn007

:octocat:
I may be slow to respond.
View GitHub Profile
@lopestom
lopestom / 0. Android Firmware File Partition Description - devices
Last active June 4, 2025 14:49
Some information about firmware files
Some informations about partitions from Android devices.
@dirkk0
dirkk0 / main.js
Last active June 4, 2025 14:49
nodejs websocket with ws and http - full minimal example
// starter was this very helpful post from @lpinca
// https://github.com/websockets/ws/issues/2052#issuecomment-1142529734
// installation: npm install ws
const WebSocketServer = require("ws");
const http = require('http');
const PORT = process.env.PORT || 8084;
@dorianim
dorianim / UptimeRobotNginxReverseProxy.conf
Created May 6, 2021 08:04
A config for the Nginx reverse proxy for proxying a UptimeRobot status page
server {
set $monitorId <YOUR_ID>;
server_name status.<YOUR_DOMAIN>;
listen 80;
location / {
proxy_set_header Host "stats.uptimerobot.com";
proxy_set_header Accept-Encoding "";
proxy_pass_request_headers on;
const magnitude = {
'十': 1e1,
'百': 1e2,
'千': 1e3,
'万': 1e4,
'亿': 1e8,
};
const num = {};
@moesoha
moesoha / worker.js
Last active June 4, 2025 14:51
Auto kick any joining users from Telegram group (deployed on Cloudflare Worker)
addEventListener('fetch', event => event.respondWith(handleRequest(event.request)));
// Add environment variable `TGBOT_TOKEN` via Worker-Settings
async function requestTelegramBotAPI(method, payload) {
return fetch(`https://api.telegram.org/bot${TGBOT_TOKEN}/${method}`, {
method: "POST",
headers: {
"Content-Type": "application/json; charset=utf-8"
},
body: !payload ? undefined : JSON.stringify(payload)
@rndazurescript
rndazurescript / CreateIso.ps1
Created June 4, 2020 01:06
Create ISO from powershell
function New-IsoFile
{
<# .Synopsis Creates a new .iso file .Description The New-IsoFile cmdlet creates a new .iso file containing content from chosen folders .Example New-IsoFile "c:\tools","c:Downloads\utils" This command creates a .iso file in $env:temp folder (default location) that contains c:\tools and c:\downloads\utils folders. The folders themselves are included at the root of the .iso image. .Example New-IsoFile -FromClipboard -Verbose Before running this command, select and copy (Ctrl-C) files/folders in Explorer first. .Example dir c:\WinPE | New-IsoFile -Path c:\temp\WinPE.iso -BootFile "${env:ProgramFiles(x86)}\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg\efisys.bin" -Media DVDPLUSR -Title "WinPE" This command creates a bootable .iso file containing the content from c:\WinPE folder, but the folder itself isn't included. Boot file etfsboot.com can be found in Windows ADK. Refer to IMAPI_MEDIA_PHYSICAL_TYPE enumeration for possible media types: http://msdn.micr
@Bluscream
Bluscream / ets2_options.md
Last active June 4, 2025 14:52
Euro Truck Simulator 2 Launch Options (Command Line Arguments)
Parameter Arguments Description Version Reference
-32bit launch directly in 32bit mode
@LynMoe
LynMoe / app.js
Last active June 4, 2025 14:52
Hexo Compressor
const _ = require('lodash')
const fs = require('fs')
const sha1 = require('sha1')
const path = require('path')
const glob = require("glob")
const sharp = require('sharp')
const fetch = require('node-fetch')
const rimraf = require("rimraf")
const imagemin = require('imagemin')
const domParser = require('dom-parser')
@RedL0tus
RedL0tus / arduinix.ino
Last active June 4, 2025 14:53
Code for Arduinix
/*
* This code is intended to use with Arduinix Shield
*
* 2019-12-22: Basic functionalities by Kay Lin
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any

How to use this?

  1. Install the USB drivers for your device (Google has a list of some universal USB drivers here)
  2. Download the ADB binary for your particular OS (Windows, Mac, Linux)
  3. Extract the zip file into a folder that you can quickly access.
  4. On your phone, go to Settings and tap on About Phone. Find the Build Number and tap on it 7 times to enable Developer Options.
  5. Now enter Developer Options and find USB Debugging. Enable it.
  6. On your computer, browse to the directory where you extracted the ADB binary.
  7. Launch a Command Prompt in your ADB folder. For Windows users, this can be done by holding Shift and Right-clicking then selecting the “open command prompt here” option.
  8. Once you’re in the command