Skip to content

Instantly share code, notes, and snippets.

@sefgit
sefgit / README.md
Created January 10, 2025 06:35 — forked from webketje/README.md
Notepad++ extension: "Open Folder as workspace" context menu entry

Notepad++ extension: "Open Folder as workspace" context menu entry

Adds a context menu entry upon right-clicking folders to open the folder as a clean workspace in Notepad++, like many other modern editors allow.
Requires Notepad++ 7.8 or higher.

Screenshot

Install

Run install.cmd as administrator, or open regedit and manually import the .reg file.

@sefgit
sefgit / lil-gui-textarea.ts
Created January 6, 2025 06:15 — forked from mistic100/lil-gui-textarea.ts
Add textarea support to lil-gui
import { GUI, Controller } from 'lil-gui';
export class TextController extends Controller {
private $button: HTMLButtonElement;
private $text: HTMLTextAreaElement;
constructor(parent: GUI, object: object, property: string, rows: number = 4) {
super(parent, object, property, 'textarea');
from contextlib import contextmanager
import sys, os
@contextmanager
def suppress_stdout():
with open(os.devnull, "w") as devnull:
old_stdout = sys.stdout
sys.stdout = devnull
try:
yield
@sefgit
sefgit / asyncio_socket_server.py
Created November 21, 2024 13:58 — forked from johnliu55tw/asyncio_socket_server.py
Python asyncio socket server template
import asyncio
import logging
# XXX: REMOVE THIS LINE IN PRODUCTION!
logging.basicConfig(format='%(asctime)s %(lineno)d %(levelname)s:%(message)s', level=logging.DEBUG)
logger = logging.getLogger(__name__)
# Connected client records
clients = dict()
@sefgit
sefgit / git-notes.txt
Created August 8, 2024 03:38
GIT notes
git fetch origin pull/ID/head:BRANCH_NAME
e.g. https://github.com/mementum/backtrader/pull/499
git fetch origin pull/499/head:PR499
git switch PR499
apply pull request patches:
git pull origin pull/469/head
@sefgit
sefgit / node-presskey-console.js
Created July 20, 2024 03:24 — forked from unitycoder/node-presskey-console.js
node.js Wait For KeyPress in console
// node.js get keypress
var stdin = process.stdin;
// without this, we would only get streams once enter is pressed
//stdin.setRawMode( true );
// resume stdin in the parent process (node app won't quit all by itself
// unless an error or process.exit() happens)
stdin.resume();
// i don't want binary, do you?
@sefgit
sefgit / to_lib.py
Last active June 19, 2024 01:48
Create import library from dll
#
# to_lib.py
# Create import library from dll
# by seffx
# Jakarta, 2024
#
# DISCLAIMER:
# Use it on your own risk, this code is provided to PUBLIC DOMAIN, "AS IS".
#
# Usage note:
@sefgit
sefgit / ceshi.ini
Created June 15, 2024 03:06 — forked from SolveSoul/ceshi.ini
V380 Pro Activate ONVIF/RTSP
[CONST_PARAM]
rtsp = 1 ; RTSPЭ�飬0���ر� 1������
@sefgit
sefgit / portable.py
Created June 12, 2024 10:34
python platform check
import platform
# Determine the correct platform for the webdriver
system = platform.system()
arch, _ = platform.architecture()
if system == 'Linux':
if arch == '64bit':
webdriver = 'bin/linux64/chromedriver'
else:
webdriver = 'bin/linux32/chromedriver'
@sefgit
sefgit / digicheck.py
Created June 12, 2024 04:35 — forked from petri/digicheck.py
Single-file Python digital signature maker and checker
"""digicheck - create and verify signatures for files
Usage:
digicheck keys
digicheck public <keyfilename>
digicheck sign <filename> <keyfilename>
digicheck check <filename> <keyfilename> <signaturefilename>
digicheck (-h | --help)
digicheck --version