Skip to content

Instantly share code, notes, and snippets.

@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active August 15, 2024 07:10
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
@pklaus
pklaus / brother_ql - Related and Unrelated Software.md
Last active August 21, 2023 11:38
brother_ql - Related and Unrelated Software
/**
* jQuery 2.1.3's parseHTML (without scripts options).
* Unlike jQuery, this returns a DocumentFragment, which is more convenient to insert into DOM.
* MIT license.
*
* If you only support Edge 13+ then try this:
function parseHTML(html, context) {
var t = (context || document).createElement('template');
t.innerHTML = html;
return t.content;
@clhenrick
clhenrick / README.md
Last active September 25, 2024 08:26
PostgreSQL & PostGIS cheatsheet (a work in progress)
@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@sdrew
sdrew / golang-upstart.conf
Created May 20, 2014 23:18
Upstart script for Go service
description "Description goes here"
author "Your Name"
start on (local-filesystems and net-device-up)
stop on runlevel [!2345]
respawn
exec /path/to/compiled/binary -flag value -flag2 value2
@elsewhat
elsewhat / trello_burndown.gs
Created December 12, 2013 14:03
Google apps script for generating daily burndown chart from trello tasks. Sends it by email (set up a trigger)
//TODO in this script
//1. Add board id in url used in TrelloAPI method (line xx
//2. Add your email in sendChartsByEmail
//3. Add your Trello keys from https://trello.com/1/appKey/generate to authorizeTrello
//4. Setup daily trigger in script editor that runs TrelloAPI()
//5. Run once in google apps script editor to authorize trello for access
//6. Lookup values and aggValues are hardcoded to the labels I use in Trello
//
//In the Trello board use scrum for trello syntax (http://scrumfortrello.com/)
//Example title: <name of task> (estimate hours) [work delivered in hours]
@joeyAghion
joeyAghion / mongodb_collection_sizes.js
Last active October 10, 2024 21:34
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
var collectionNames = db.getCollectionNames(), stats = [];
collectionNames.forEach(function (n) { stats.push(db[n].stats()); });
stats = stats.sort(function(a, b) { return b['size'] - a['size']; });
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); }
@douglasjarquin
douglasjarquin / mongos.init
Created June 12, 2013 23:00
A mongos init script for Amazon Linux
#!/bin/bash
# mongos - Startup script for mongos
# chkconfig: 35 85 15
# description: Mongo is a scalable, document-oriented database.
# processname: mongos
# config: /etc/mongos.conf
# pidfile: /var/run/mongo/mongos.pid
@imminent
imminent / ObjectGraph.java
Last active October 23, 2017 07:39
Dagger `ObjectGraph` utility to hide the mess of injecting the different Android classes. Note this is inspired by https://github.com/pyricau/CleanAndroidCode/blob/master/cleanandroidcode/src/main/java/info/piwai/cleanandroidcode/base/GraphRetriever.java
import javax.annotation.Nonnull;
import android.app.Activity;
import android.app.Service;
import android.support.v4.app.Fragment;
import android.content.Context;
/**
* <p>Retrieves the {@link dagger.ObjectGraph} and injects dependencies.</p>
* @author Dandré Allison