Skip to content

Instantly share code, notes, and snippets.

View michaelgold's full-sized avatar

Michael Gold michaelgold

View GitHub Profile
@psychemedia
psychemedia / GPT4all-langchain-demo.ipynb
Last active December 21, 2023 17:30
Example of running GPT4all local LLM via langchain in a Jupyter notebook (Python)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tafaust
tafaust / application.py
Created April 21, 2022 19:41
FastAPI singleton service dependency injection across multiple requests
import random
import click
import uvicorn
from fastapi import FastAPI, APIRouter, Depends, Request
# Service
class MySingletonService:
def __init__(self):
@haykkh
haykkh / fastapi-discord.py
Created June 24, 2020 10:09
How to run a discord.py bot with FastAPI
import asyncio
import discord
from fastapi import FastAPI
app = FastAPI()
client = discord.Client()
# where the magic happens
# register an asyncio.create_task(client.start()) on app's startup event
@silver-xu
silver-xu / ts-boilerplate.md
Last active October 31, 2024 12:16
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting
@tin2tin
tin2tin / basic_ui_documented.py
Last active May 22, 2024 13:24 — forked from AzureDVBB/basic_ui_documented.py
A commented template for making simple UI in blender using the bpy python API
#import the bpy module to access blender API
import bpy
#WARNING: this is written and tested for blender 2.79
#blender 2.8 and newer will likely have a different python API
#create a property group, this is REALLY needed so that operators
#AND the UI can access, display and expose it to the user to change
#in here we will have all properties(variables) that is neccessary
class CustomPropertyGroup(bpy.types.PropertyGroup):
@bittner
bittner / keyboard-keys.md
Created February 28, 2019 22:50
Keyboard keys markup in MarkDown

Ctrl + Alt + Space

@dmidlo
dmidlo / pltask.zsh
Last active October 17, 2017 19:17
#pltask functions
## pltask is a lightweight facade to taskwarrior for use with Powerlevel9k's Second Prompt Prefix (by dmidlo @querentCode)
## Be sure to set search.case.sensitive=no within .taskrc
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="\n"
pltask () {
setNewlinePrompt () {
POWERLEVEL9K_MULTILINE_SECOND_PROMPT_PREFIX="%K{white}%F{black}\n $1 %f%k%F{white}%f $ "
@CSaratakij
CSaratakij / .tmux.conf
Last active June 22, 2024 08:10
Tmux's Config that's very close to i3wm (Setting with an idea of using tmux without x-server)
# Config that is very close to a i3 window manager's keybinding.
set -s escape-time 0
setw -g aggressive-resize on
# First remove *all* keybindings
unbind-key -a
# List keys
bind-key ? list-keys
@diverted247
diverted247 / README
Last active November 14, 2024 22:01
Export slides from Google Slides as SVG - Console Script (Chrome tested)
To export SVG from Google Slides.
1. Open Slide deck.
2. View -> 100%
3. Click on every thumbnail from first to last, this puts the SVG into the DOM.
4. Paste the export.js in the console.
5. Make sure to allow multiple downloads.
6. All SVG should be in Downloads folder.
Cheers,
@wormeyman
wormeyman / Source_Code_Pro_Powershell_font.ps1
Last active March 10, 2020 10:26
Set Adobe's Source Code Pro as a PowerShell font option.
#Reference: http://michaellwest.blogspot.com/2013/03/add-font-to-powershell-console.html
#Reference: http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q247815 This explains why we name it 000
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont' #Get the properties of TTF
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont' -Name 000 -Value 'Source Code Pro' #Set it to SCP
Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont' #Check to see if we properly set it so that SCP is an option