Skip to content

Instantly share code, notes, and snippets.

View mathiasschopmans's full-sized avatar

Mathias Schopmans mathiasschopmans

View GitHub Profile
@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
@pazguille
pazguille / rsc.jsx
Last active April 11, 2024 05:35
Deno + RSC
// deno run --allow-net rsc.jsx
// deno run --allow-net https://gist.githubusercontent.com/pazguille/a2e3792c1901e12e67453ccb19cc0da6/raw/752200e809993fd2176381b7b09d8308dca6d069/rsc.jsx
import { serve } from 'https://deno.land/std/http/server.ts';
import React, { Suspense } from "https://esm.sh/[email protected]";
import ReactDOMServer from 'https://esm.sh/[email protected]/server';
import ReactServerDOMServer from 'https://esm.sh/[email protected]/server.browser';
import ReactServerDOMClient from 'https://esm.sh/[email protected]/client';
function Hello({ name }) {
@stalniy
stalniy / abilities.js
Created January 5, 2018 20:58
CASL Vue routes
import { AbilityBuilder, Ability } from 'casl'
// Alternatively this data can be retrieved from server
export default function defineAbilitiesFor(user) {
const { rules, can } = AbilityBuilder.extract()
can('read', 'User')
can('update', 'User', { id: user.id })
if (user.role === 'doctor') {
@StevenACoffman
StevenACoffman / Docker Best Practices.md
Last active November 9, 2024 17:19
Docker Best Practices

Mistakes to Avoid: Docker Antipatterns

Whichever route you take to implementing containers, you’ll want to steer clear of common pitfalls that can undermine the efficiency of your Docker stack.

Don’t run too many processes inside a single container

The beauty of containers—and an advantage of containers over virtual machines—is that it is easy to make multiple containers interact with one another in order to compose a complete application. There is no need to run a full application inside a single container. Instead, break your application down as much as possible into discrete services, and distribute services across multiple containers. This maximizes flexibility and reliability.

Don’t install operating systems inside Docker containers

It is possible to install a complete Linux operating system inside a container. In most cases, however, this is not necessary. If your goal is to host just a single application or part of an application in the container, you need to install only the essential

@ysr23
ysr23 / pi zero W ap setup.md
Last active September 18, 2024 14:50
Raspberry Pi Zero W Access Point (ap) setup

These are my own personal notes on how i setup a Pi Zero W as an access points it is a blatant copy of this: https://gist.github.com/tcg/0c1d32770fcf6a0acf448b7358c5d059 but is just missing a couple of things from: http://imti.co/post/145442415333/raspberry-pi-3-wifi-station-ap and like tcg, this is not intended as a guide but notes as i will invariably have to rebuild this sometime and i have broken biscuits for brains.

1. making the pi zero accesible from a computer

this is really just the same info as here https://gist.github.com/gbaman/975e2db164b3ca2b51ae11e45e8fd40a

  • flash raspbian lite to sd card
  • unplug and replug sd card adapter if necessary to see 'boot' drive
  • edit cmdline.txt add: modules-load=dwc2,g_ether after the word rootwait
  • edit config.txt and add dtoverlay=dwc2 to the end of the file
  • create a blank file called ssh
@jamieweavis
jamieweavis / macos-app-icon.md
Last active October 10, 2024 23:10
How to create an .icns macOS app icon
@doctaweeks
doctaweeks / nypost_adblock_block_block.user.js
Last active December 23, 2018 10:37
Block the New York Post adblock block
// ==UserScript==
// @name nypost_adblock_block_block
// @namespace doctaweeks
// @include https://nypost.com/*
// @version 1
// @grant none
// ==/UserScript==
window.addEventListener('beforescriptexecute', function(e) {
window._sp_.config.content_control_callback = null;
# Defaults / Configuration options for homebridge
# The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others)
HOMEBRIDGE_OPTS=-U /var/lib/homebridge
# If you uncomment the following line, homebridge will log more
# You can display this via systemd's journalctl: journalctl -f -u homebridge
# DEBUG=*
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE