Skip to content

Instantly share code, notes, and snippets.

@sefgit
sefgit / api.py
Created May 2, 2025 01:14 — forked from raphaeljolivet/api.py
Add custom rest API to streamlit app
# This code adds custom REST api handler at runtime to a running Streamlit app
#
from tornado.web import Application, RequestHandler
from tornado.routing import Rule, PathMatches
import gc
import streamlit as st
@st.cache_resource()
@sefgit
sefgit / clr_via_native.c
Created April 20, 2025 01:57 — forked from xpn/clr_via_native.c
A quick example showing loading CLR via native code
#include "stdafx.h"
int main()
{
ICLRMetaHost *metaHost = NULL;
IEnumUnknown *runtime = NULL;
ICLRRuntimeInfo *runtimeInfo = NULL;
ICLRRuntimeHost *runtimeHost = NULL;
IUnknown *enumRuntime = NULL;
LPWSTR frameworkName = NULL;
#!/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
even the implied warranty of MERCHANTABILITY or FITNESS FOR A
@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
@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 / 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 / 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 / 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 / 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 / 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.
*/