Skip to content

Instantly share code, notes, and snippets.

View gaozhidf's full-sized avatar
💭
I may be slow to respond.

里丰 gaozhidf

💭
I may be slow to respond.
View GitHub Profile
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@nhtua
nhtua / 00.install-android-sdk.sh
Last active April 7, 2026 12:34
Run a Headless Android Device on Ubuntu server (no GUI)
#!/bin/bash -i
#using shebang with -i to enable interactive mode (auto load .bashrc)
set -e #stop immediately if any error happens
# Install Open SDK
apt update
apt install openjdk-8-jdk -y
update-java-alternatives --set java-1.8.0-openjdk-amd64
java -version
@podhmo
podhmo / sqlalchemy_example.py
Created December 20, 2012 14:59
sqlalchemy query example.
import sqlalchemy as sa
import sqlalchemy.orm as orm
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import scoped_session, sessionmaker
DBSession = scoped_session(sessionmaker())
class BaseMixin(object):
query = DBSession.query_property()
id = sa.Column(sa.Integer, primary_key=True)
@yulanggong
yulanggong / webtools.js
Created August 28, 2012 05:05
Some Web development tools for Notepad++ (NppScripting)
/**
* Some Web development tools for Notepad++ (NppScripting)
* Based on jsbeautifier.js and service of reducisaurus.appspot.com.
*/
var format = Editor.addMenu("Webtools");
format.addItem({
text:"JSBeautify\tCtrl+Shift+F",
cmd:function(){do_js_beautify();}
});