Skip to content

Instantly share code, notes, and snippets.

View rheinardkorf's full-sized avatar

Rheinard Korf rheinardkorf

View GitHub Profile
@rheinardkorf
rheinardkorf / llama2-mac-gpu.sh
Created July 19, 2023 13:09 — forked from adrienbrault/llama2-mac-gpu.sh
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
wget "https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/main/${MODEL}"
@rheinardkorf
rheinardkorf / brew-instructions.sh
Created March 9, 2019 10:32 — forked from petemcw/brew-instructions.sh
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.dev domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache
@rheinardkorf
rheinardkorf / Wordpress Nginx Config
Created March 14, 2017 06:41 — forked from kjprince/Wordpress Nginx Config
/etc/nginx/wordpress.conf
##################################
# WORDPRESS NGINX CONFIGURATIONS
##################################
# /etc/nginx/wordpress.conf
#
# Contains a common configuration for use by nginx on a WordPress
# installation. This file should be included in any WordPress site
# nginx virtual host config located in sites-available with the following line:
#
# include /etc/nginx/wordpress.config;
<?php
/**
* Whitelist embedded links in the REST API responses
*
* This is often useful if you want to only get specified resources embedded along with the
* main resources, rather than the "all of nothing" approach of passing `?_embed` to the API request.
*
* You can either pass a comma seperated list of relationships or an array of string via the `_embed_include` query param.
*
@rheinardkorf
rheinardkorf / 0_reuse_code.js
Created September 20, 2016 06:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
class MyPlugin {
/**
* Add this at top of your plugin class constructor or whichever method in your class you use to bootstrap your plugin.
* e.g. public static function bootstrap()
*/
public static function bootstrap() {
if ( version_compare( '5.3', phpversion(), '>' ) ) {
@rheinardkorf
rheinardkorf / developer_login.php
Last active January 11, 2016 01:16
WordPress auto-login
<?php
/*
* Auto-login script to save having to manually login when developing a WP site.
*
* Place in wp-content/mu-plugins and remember to add to .gitignore for safety
*
* Add the DEV_GET_PARAMETER to the url to activate the script and login for you
* e.g. http://localhost:8080/?dev
*/