Skip to content

Instantly share code, notes, and snippets.

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 / 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');
@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 / object-watch.js
Created January 18, 2025 00:56 — forked from Unitech/object-watch.js
object.watch polyfill
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@sefgit
sefgit / screenshot.vue
Created January 30, 2025 09:49 — forked from bcakmakoglu/screenshot.vue
Create a screenshot of a vue flow component
<script lang="ts" setup>
import {
VueFlow,
MiniMap,
Controls,
Background,
Connection,
Edge,
Elements,
FlowElement,
@sefgit
sefgit / index.htm
Created February 4, 2025 19:54 — forked from nathanlesage/index.htm
ContentEditable Demo (CodeMirror 6)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ContentEditable Demo</title>
<script src="index.js"></script>
</head>
<body>
@sefgit
sefgit / media-query.css
Created March 12, 2025 09:29 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@sefgit
sefgit / README.md
Created March 15, 2025 03:24 — forked from shawnohare/README.md
asyncio socket client / server example

A basic example of using the higher level asyncio constructs such as streams in a server and client where both pass messages with regular cadence.

@sefgit
sefgit / main.cpp
Created April 10, 2025 07:44 — forked from enghqii/main.cpp
Win32 Console Double Buffering
#include <windows.h>
#include <stdio.h>
#define WIDTH 120
#define HEIGHT 30
float playerX = 0;
float playerY = 0;
float dx = 0,dy = 0;
@sefgit
sefgit / matplotlib_bottons_x_axis_zoom.py
Created April 13, 2025 14:48 — forked from saeedghsh/matplotlib_bottons_x_axis_zoom.py
A Matplotlib plot with bottons and mouse scroll for y-axis zooming
#!/usr/bin/python3
'''
Copyright (C) Saeed Gholami Shahbandi. All rights reserved.
Author: Saeed Gholami Shahbandi
This file is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. This program is distributed in
the hope that it will be useful, but WITHOUT ANY WARRANTY; without