Skip to content

Instantly share code, notes, and snippets.

View k-zehnder's full-sized avatar
😀

Kevin Zehnder k-zehnder

😀
View GitHub Profile
@mberman84
mberman84 / gist:931fb7acf8c99279a54053328c2f074a
Created March 12, 2025 20:50
claude_desktop_config.json
{
"mcpServers": {
"count-r": {
"command": "python",
"args": [
"C:\\Users\\mberm\\count-r-server\\server.py"
],
"host": "127.0.0.1",
"port": 8080,
"timeout": 30000
from mcp.server.fastmcp import FastMCP
import time
import signal
import sys
# Handle SIGINT (Ctrl+C) gracefully
def signal_handler(sig, frame):
print("Shutting down server gracefully...")
sys.exit(0)
@mberman84
mberman84 / main.py
Created November 10, 2023 16:17
OpenChat Code
import requests
import json
import gradio as gr
url = "http://localhost:11434/api/generate"
headers = {
'Content-Type': 'application/json',
}
@holvi-mikael
holvi-mikael / reactive_menu.py
Created August 1, 2022 18:21
Basic reactive menu layout
import flet
from flet import AppBar
from flet import Card
from flet import Column
from flet import Container
from flet import Icon
from flet import IconButton
from flet import NavigationRail
from flet import NavigationRailDestination
from flet import Page
@iforvard
iforvard / fs.py
Created July 27, 2022 22:27
File manager concept on flat
import os
from pathlib import Path
from flet import icons, flet, Page, Row, ElevatedButton, GridView, TextButton, TextField
def setup_page(page: Page):
page.theme_mode = "dark"
@dnnysng
dnnysng / contact.html
Created March 8, 2022 03:24
Hidden form so Netlify can detect in React
<form name="contact" netlify netlify-honeypot="bot-field" hidden>
<input type="text" name="name" />
<input type="email" name="email" />
<textarea name="message"></textarea>
</form>
@jerry-git
jerry-git / vax_app.py
Last active September 19, 2024 12:20
Simple modern Python web app
import datetime as dt
import os
import motor
from beanie import Document, Indexed, PydanticObjectId, init_beanie, operators
from fastapi import FastAPI, Response, status
from pydantic import BaseModel
app = FastAPI()
@nhall97
nhall97 / app.js
Created November 18, 2021 16:05
Login Auth with React Apps - react-router-dom
//https://www.digitalocean.com/community/tutorials/how-to-add-login-authentication-to-react-applications
//By default, react-router-dom is now ^6.0.2.
//Below are the significant changes for the tutorial to use the new version of react-router-dom
//Line 14 -> Switch has been replaced with Routes
//Line 29/34 -> Switch has been replaced with Routes (2)
import React, { useState }from "react";
import "./App.css";
@bradtraversy
bradtraversy / typescript-crash.ts
Last active February 23, 2025 18:41
Basic intro to TypeScript (From YouTube Crash Course)
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
@Babatunde13
Babatunde13 / app.py
Last active March 31, 2024 08:41
The first part of my Flask and SQLAlchemy series.
from flask import Flask, jsonify, request
from flask_sqlalchemy import SQLAlchemy
import uuid
app = Flask(__name__)
db = SQLAlchemy(app)
app.config['SECRET_KEY']='secret'
app.config['SQLALCHEMY_DATABASE_URI']='sqlite:///app.db'