Skip to content

Instantly share code, notes, and snippets.

@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active July 1, 2024 05:32
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@mgrider
mgrider / vim-swift-setup.sh
Last active March 22, 2024 01:55 — forked from jlehikoinen/setup.sh
Swift syntax highlighting for Vim
# Swift syntax highlighting for Vim
# Original Source: http://wingsquare.com/blog/swift-script-syntax-highlighting-and-indentation-for-vim-text-editor/
# Another helpful article: https://billyto.github.io/blog/swift-syntax-vim
# More about Vim packages: http://vimcasts.org/episodes/packages/
echo "--- creating ~/.vim/pack/bundle/start dir.."
mkdir -p ~/.vim/pack/bundle/start
echo "--- Cloning Apple's Swift repo.."
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
enum SkyBehavior: String {
case clickSky = "clickSky"
case clickSun = "clickSun"
case clickSunspot = "clickSunspot"
}
@matsuda
matsuda / memoryAddress.swift
Last active March 14, 2024 09:41
Get memory address in Swift
///
/// https://stackoverflow.com/a/29741007
///
let s = Struct() // Struct
withUnsafePointer(to: s) {
print(String(format: "%p", $0)
}
///
/// http://stackoverflow.com/a/36539213/226791