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 / 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 November 10, 2024 08:39
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'
@abdorah
abdorah / HttpCrudRequests.js
Last active September 25, 2022 18:07
async fetch class that make it easy to perform http crud request in vanilla js.
class HttpCrudRequests {
async get(url) {
const res = await fetch(url)
const data = await res.json()
return data
}
async post(url, post) {
const res = await fetch(url, {
@peterVG
peterVG / ipfs-on-raspberry-pi.md
Last active October 31, 2024 11:41
Put IPFS decentralized storage on your Raspberry Pi with USB storage

I put IPFS on a Raspberry Pi and so should you!

Total cost of joining the decentralized storage revolution with your own lo-fi node: $124 USD

raspberry-ipfs