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
@dirkk0
dirkk0 / main.js
Last active November 29, 2023 08:12
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 May 5, 2022 15:12
Auto kick added member 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)
@Bluscream
Bluscream / ets2_options.md
Last active May 4, 2024 11:11
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 October 3, 2020 07:19
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 January 8, 2020 12:57
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
@JerryLokjianming
JerryLokjianming / Crack Sublime Text Windows and Linux.md
Last active April 25, 2024 04:03
Crack Sublime Text 3.2.2 Build 3211 and Sublime Text 4 Alpha 4098 with Hex

How to Crack Sublime Text 3.2.2 Build 3211 with Hex Editor (Windows | Without License) ↓

  1. Download & Install Sublime Text 3.2.2 Build 3211
  2. Visit https://hexed.it/
  3. Open file select sublime_text.exe
  4. Offset 0x8545: Original 84 -> 85
  5. Offset 0x08FF19: Original 75 -> EB
  6. Offset 0x1932C7: Original 75 -> 74 (remove UNREGISTERED in title bar, so no need to use a license)
import requests
import itertools
import sys,re
from PIL import Image
import zbarlight
colors = "LRUDFB"
def loadImage(filename):
img = Image.open(filename)