Skip to content

Instantly share code, notes, and snippets.

View weichensw's full-sized avatar

Wei Chen weichensw

View GitHub Profile
@veekaybee
veekaybee / normcore-llm.md
Last active July 3, 2024 22:14
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@joeddav
joeddav / chatgpt.py
Last active August 5, 2023 14:29
Simple ChatGPT
import openai
class ChatGPT:
""" A very simple wrapper around OpenAI's ChatGPT API. Makes it easy to create custom messages & chat. """
def __init__(self, model="gpt-3.5-turbo", completion_hparams=None):
self.model = model
self.completion_hparams = completion_hparams or {}
self.history = []
self._messages = []
@naikrovek
naikrovek / README.md
Last active October 12, 2022 08:45
AutoHotKey Scripts for arranging app windows on a UHD monitor.

start AutoHotKeyu64.exe wm4k.ahd should launch it. both of the files in this gist should be in the same directory.

with NUMLOCK off, pushing number keys will move windows around. 8 will resize a window to fit 1/8th of your screen (1/4 width, 1/2 height.)

Similar operations for 1, 2, 3, 4, and 6. CTRL does things in combination with 3, 4, and 6, so try those.

Numpad * (with numlock off, always) will arrange a window to occupy 1/12th of the screen (1/6th horizontally and 1/2 vertically).

NEW - Numpad+ and Numpad- will adjust a window's position horizontally

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active July 3, 2024 17:43
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;
}
@p3x-robot
p3x-robot / ntfs-file-system-increase-speed-performance.com
Last active May 15, 2024 14:02
🚄 This is a simple utility to increase the NTFS performance by turning off some NTFS features that are not so used by now (or not so important).
rem execute as an Administrator
rem based on http://www.windowsdevcenter.com/pub/a/windows/2005/02/08/NTFS_Hacks.html
ram based on https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc938961(v=technet.10)
rem http://archive.oreilly.com/cs/user/view/cs_msg/95219 (some installers need 8dot3 filenames)
rem disable 8dot3 filenames
ram Warning: Some applications such as incremental backup utilities rely on this update information and do not function correctly without it.
fsutil behavior set disable8dot3 1
@legowerewolf
legowerewolf / hyperstart.bat
Last active December 29, 2023 16:45
Selecting a shell on startup in the Hyper terminal emulator
@ECHO off
:top
CLS
ECHO Choose a shell:
ECHO [1] cmd
ECHO [2] bash
ECHO [3] PowerShell
ECHO [4] Python
ECHO.
ECHO [5] restart elevated
@frontdevops
frontdevops / darkthemeswitcher-inline.js
Last active May 5, 2024 17:54
Simple Dark Theme Bookmarklet for web pages
javascript:(d=>{var css=`:root{background-color:#fefefe;filter:invert(100%)}*{background-color:inherit}img:not([src*=".svg"]),video{filter: invert(100%)}`,style,id="dark-theme-snippet",ee=d.getElementById(id);if(null!=ee)ee.parentNode.removeChild(ee);else {style = d.createElement('style');style.type="text/css";style.id=id;if(style.styleSheet)style.styleSheet.cssText=css;else style.appendChild(d.createTextNode(css));(d.head||d.querySelector('head')).appendChild(style)}})(document)
@michaelowens
michaelowens / README.md
Last active March 20, 2020 07:18
jQTpl - A simple jQuery template engine/mini framework.

jQTpl

jQTpl - A simple jQuery template engine/mini framework.

I made this to easily be able to add UI elements, with 2-way binding, to websites using tampermonkey scripts. Feel free to do whatever you want.

@tinogomes
tinogomes / DNS_TO_LOCALHOST.markdown
Last active June 29, 2024 06:45
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.

Example:

# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.com
@sqs
sqs / ToSourcegraph.js
Created May 4, 2017 20:43
Jump to Sourcegraph bookmarklet
javascript:(function(){ if (window.location.hostname !== "github.com" && window.location.hostname !== "sourcegraph.com") { alert("This bookmarklet may only be used on GitHub.com or Sourcegraph.com, not " + window.location.hostname + "."); return; } var pats = [ ["^/([^/]+)/([^/]+)/tree/([^/]+)$", "/github.com/$1/$2@$3", "^/github\.com/([^/]+)/([^/@]+)@([^/]+)$", "/$1/$2/tree/$3"], ["^/([^/]+)/([^/]+)/tree/([^/]+)/(.+)$", "/github.com/$1/$2@$3/-/tree/$4", "^/github\.com/([^/]+)/([^/@]+)@([^/]+)/-/tree/(.+)$", "/$1/$2/tree/$3/$4"], ["^/([^/]+)/([^/]+)/blob/([^/]+)/(.+)$", "/github.com/$1/$2@$3/-/blob/$4", "", ""], ["^/([^/]+)/([^/]+)$", "/github.com/$1/$2", "^/github\.com/([^/]+)/([^/]+)$", "/$1/$2"], ["^/([^/]+)$", "/$1", "^/([^/]+)$", "/$1"], ]; var pathname = window.location.pathname; if (window.location.hostname === 'sourcegraph.com') { if (pathname.indexOf('/sourcegraph.com/') === 0) { pathname = pathname.replace('/sourcegraph.com/', '/github.com/'); } else if (pathname.indexOf('/sourcegraph/') === 0) { pa