Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / add_to_zshrc.sh
Created August 25, 2024 20:43
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {
@NSExceptional
NSExceptional / AutoLayout.md
Last active December 8, 2021 06:19
The best damn AutoLayout guide I've ever seen

Edit Feb 4 5:16 PM: Skip to the bottom if you just want the article

It has been brought to my attention that rehosting someone else's content without asking them — even if you link to the original content — is not exactly polite. I did not ask the author before I rehosted his article, and while I feel I should have known better than to that, it just didn't occurr to me. It's not exactly plagarism, but it's still wrong on some level. I have reached out to him now about hosting it here publically, and if he says it's alright, I'll put it back.

You can find the original article here, on his site, and on his Medium page.

@iceydee
iceydee / convert_cookies_plist.rb
Created October 5, 2011 06:33
A simple script to convert Safari Cookies.plist to cookies.txt format. This is a minor rewrite from the script found here: http://seriousorange.com/2010/01/converting-safari-cookies-plist-to-cookies-txt/
#!/usr/bin/env ruby
require 'plist'
result = Plist::parse_xml(File.expand_path("~/Library/Cookies/Cookies.plist"))
result.each do |r|
arr = []
arr += [r["Domain"], "TRUE"]
arr += [r["Path"], "FALSE"]
arr << r["Expires"].strftime("%s")