Skip to content

Instantly share code, notes, and snippets.

View fabianperez's full-sized avatar
🤠

Fabian Perez fabianperez

🤠
View GitHub Profile
@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 22, 2024 08:47
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
import * as React from 'react'
import { SpringValue, easings, useSpring } from 'react-spring'
/**
* Hook that animates height when args.animationKey changes
*
* Ex:
* const animatedBlock = useAnimatedHeight({
* animationKey: key,
* })
@phortuin
phortuin / postgres.md
Last active June 16, 2024 09:36
Set up postgres + database on MacOS (M1)

Based on this blogpost.

Install with Homebrew:

$ brew install postgresql@14

(The version number 14 needs to be explicitly stated. The @ mark designates a version number is specified. If you need an older version of postgres, use postgresql@13, for example.)

let rtcConnection = null;
let rtcLoopbackConnection = null;
let loopbackStream = new MediaStream(); // this is the stream you will read from for actual audio output
const offerOptions = {
offerVideo: true,
offerAudio: true,
offerToReceiveAudio: false,
offerToReceiveVideo: false,
};
@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active June 14, 2024 06:30
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@YaFou
YaFou / ci.yml
Last active April 22, 2020 20:40
Some GitHub Actions workflows for continuous integration and nightly builds with PHP
name: Continuous integration
on:
push:
paths-ignore:
- '**.md'
- '.github/**'
pull_request:
paths-ignore:
- '**.md'
@kdepp
kdepp / AudioHardware.h
Created November 19, 2019 04:48
Core Audio Header Files
/*==================================================================================================
File: CoreAudio/AudioHardware.h
Contains: API for communicating with audio hardware.
Copyright: (c) 1985-2011 by Apple, Inc., all rights reserved.
Bugs?: For bug reports, consult the following page on
the World Wide Web:
@andywer
andywer / Monorepo Setup.md
Last active April 8, 2022 03:50
Monorepo Setup

Overall Approach

This document is a short description of the monorepo setup that I came up for a few different smaller projects in the last 8 months or so.

Directory structure

/
  services/
 product/
@nperony
nperony / call_recording_instructions.md
Last active January 22, 2020 08:45
Recording simultaneous bi-directional raw audio streams (e.g. calls) on OS X

Recording simultaneous bi-directional raw audio streams (e.g. calls) on OS X


Steps

  1. Install kernel module to mirror speaker/headphones audio onto input interface
  2. Create a virtual "multi-output" device to pipe audio output simultaneously to speakers/headphones and input interface
  3. Create a virtual "aggregate" device to multiplex output/input audio channels
  4. Record audio file
  5. Blend channels, normalise audio, export stereo file.
@jgamblin
jgamblin / slackspotify.sh
Created April 19, 2017 01:10
A Script To Set Current Spotify Song As Slack Status
#!/bin/bash
APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens"
SONG=$(osascript -e 'tell application "Spotify" to name of current track as string')
URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"')
while true
do
curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null
sleep 60
done