Skip to content

Instantly share code, notes, and snippets.

Karpathy Guidelines 12 Rules

Behavioral guidelines to reduce common LLM coding mistakes, derived from Andrej Karpathy's observations on LLM coding pitfalls.

These rules apply to every task in this project unless explicitly overridden. Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment.

1. Think Before Coding

Don't assume. Don't hide confusion. Surface tradeoffs.

@netstu
netstu / phpenv-macos.sh
Created July 22, 2024 11:03 — forked from christopher-hopper/phpenv-macos.sh
Install phpenv on macOS with homebrew php packages.
#!/usr/bin/env bash
# vim: ai ts=2 sw=2 et sts=2 ft=sh
# Install or re-install phpenv with
# multiple versions of PHP on macOS.
#
# Usage:
#
# curl -fsSL "https://git.io/JvG7i?cb=$RANDOM" | bash
#

How to use O-MVLL with WSL for Android projects

  • Use this guide to integrate the O-MVLL obfuscator using WSL and command line
  • The guide has two parts, the first one explains the installation of Android build tools, the second part presents all the adjustments I needed to make to standard O-MVLL integration process (https://obfuscator.re/omvll/introduction/getting-started/). Read that 'Getting started' guide first.

Preparing the WSL for commandline Android development

Based on this article https://dev.to/halimsamy/wsl-for-developers-installing-the-android-sdk-53n9

Installing OpenJDK and Gradle

sudo apt-get update
@netstu
netstu / gist:23fc43ad27a6602352c24ab5c1a0675d
Created December 7, 2018 15:49 — forked from mstfldmr/gist:f6594b2337e3633673e5
Example of Volley GET and POST requests with parameters and headers
RequestQueue queue = Volley.newRequestQueue(context);
//for POST requests, only the following line should be changed to
StringRequest sr = new StringRequest(Request.Method.GET, "http://headers.jsontest.com/",
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.e("HttpClient", "success! response: " + response.toString());
}
},
@netstu
netstu / MainActivity.java
Created June 22, 2018 09:07 — forked from blackcj/MainActivity.java
Design support library with CoordinatorLayout, SwipeRefreshLayout and RecyclerView.
import android.os.Bundle;
import android.support.design.widget.AppBarLayout;
import android.support.design.widget.TabLayout;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import com.blackcj.designsupportexample.adapters.RecyclerViewAdapter;
/**
* 百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换的工具
*
* 参考 https://github.com/wandergis/coordtransform 实现的Java版本
* @author geosmart
*/
public class CoordinateTransformUtil {
static double x_pi = 3.14159265358979324 * 3000.0 / 180.0;
// π
static double pi = 3.1415926535897932384626;
@netstu
netstu / StringUtils.java
Created December 12, 2014 04:38
java 字符串工具类
import java.util.*;
public class StringUtils
{
public StringUtils()
{
}
public static boolean isEmpty(String str)
@netstu
netstu / test5
Created December 20, 2013 13:06
以下内容粘贴到“AppleScript编辑器”中,保存为“sendMsg.scpt”: 使用方法为,在“终端”中运行命令: osascript sendMsg.scpt 'iMessageId' 'flood attack' 1000 三个参数分别是“iMessage的id”, “发送内容”和“发送次数”
on run {targetBuddyPhone, targetMessage, repeatCount}
tell application "Messages"
set targetService to 1st service whose service type = iMessage
set targetBuddy to buddy targetBuddyPhone of targetService
set myCount to repeatCount as integer
repeat myCount times
send targetMessage to targetBuddy
end repeat
end tell
end run
@netstu
netstu / test4
Created December 20, 2013 05:46
applescript 利用 curl 请求获得数据
set shellScript to "curl \"http://www.baidu.com\""
do shell script shellScript
@netstu
netstu / test3
Created December 20, 2013 05:44
applescript
set csvData to read "/Users/netstu/Downloads/mbis.csv"
set csvEntries to paragraphs of csvData
repeat with i from 1 to count csvEntries
set phone to (csvEntries's item i)'s text
tell application "System Events" to tell process "Messages"
set input to "how are you" as text
click button 1 of group 1 of splitter group 1 of window 1
delay 1
keystroke "" & phone & "" -- type the reciever
keystroke return -- validate the previous input