Skip to content

Instantly share code, notes, and snippets.

@allanrbo
allanrbo / chatgpt.py
Created June 19, 2023 07:08
ChatGPT from your command line, without any library dependencies (API key required)
#!/usr/bin/python3
# Quick and dirty ChatGPT from your command line, without any library dependencies (API key required)
# End your input with a line consisting of just ---
# Stop generating with ctrl-c
from urllib.request import Request, urlopen
import json
messages = []
@rain-1
rain-1 / LLM.md
Last active April 24, 2024 08:25
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@nileshtrivedi
nileshtrivedi / Caddyfile
Created November 14, 2021 18:30
Caddy on fly.io as reverse proxy to services on Tailscale network
log stdout
errors stdout
auto_https off
http://myapp.fly.dev {
reverse_proxy 100.120.108.62:8000
}
@vncsna
vncsna / bash_strict_mode.md
Created June 6, 2021 01:59 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u
@MineRobber9000
MineRobber9000 / 2fa
Created April 3, 2020 03:45
2-factor authentication terminal app in Python
#!/usr/bin/env python
import os, os.path, stat, sys, base64
# TOTP lib inlined
import time, hmac, base64, hashlib, struct
def pack_counter(t):
return struct.pack(">Q", t)
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@jkjung-avt
jkjung-avt / openalpr_camera.py
Last active December 20, 2023 20:36
Real-time license plate recognition with 'openalpr' using a video file as input. Please check out my "Building and Testing 'openalpr' on Jetson TX2" post for more information: https://jkjung-avt.github.io/openalpr-on-tx2/
# test_camera.py
#
# Open an RTSP stream and feed image frames to 'openalpr'
# for real-time license plate recognition.
import numpy as np
import cv2
from openalpr import Alpr
@nicolasdao
nicolasdao / open_source_licenses.md
Last active April 23, 2024 23:27
What you need to know to choose an open source license.
@pcan
pcan / README.md
Last active April 17, 2024 01:45
Node.js plain TLS Client & Server, 2-way Cert Auth

Node.js TLS plain TLS sockets

This guide shows how to set up a bidirectional client/server authentication for plain TLS sockets.

Newer versions of openssl are stricter about certificate purposes. Use extensions accordingly.

Prepare certificates

Generate a Certificate Authority: