Skip to content

Instantly share code, notes, and snippets.

@nebrelbug
nebrelbug / accelerate_config.yaml
Last active November 8, 2023 01:50
Rebuilding Alpaca with the Hugging Face Trainer Class (see https://bengubler.com/posts/rebuilding-alpaca-huggingface-trainer)
compute_environment: LOCAL_MACHINE
deepspeed_config: {}
distributed_type: 'NO'
downcast_bf16: 'no'
machine_rank: 0
main_process_ip: null
main_process_port: null
main_training_function: main
mixed_precision: 'no'
num_machines: 1
@rom1504
rom1504 / distributed_dalle2_laion.md
Last active April 7, 2024 13:16
distributed dalle2 laion
@eh8
eh8 / README.md
Last active December 13, 2020 06:36
macOS Big Chungus

From r/unixporn

macOS Big Chungus


Find the official macOS wallpapers complied in a neat Google Photos album.

This setup relies on a few GNOME shell extensions, all of which are available from the AUR.

@nebrelbug
nebrelbug / .bashrc
Last active November 28, 2019 04:46
NiftyBash: customize terminal prompt to show package.json version, git branch, and commit status (this is the end of my `.bashrc`)
COLOR_RED="\033[0;31m"
COLOR_YELLOW="\033[0;33m"
COLOR_GREEN="\033[0;32m"
COLOR_OCHRE="\033[38;5;95m"
COLOR_BLUE="\033[0;34m"
COLOR_WHITE="\033[0;37m"
COLOR_RESET="\033[0m"
function git_color() {
local git_status="$(git status 2>/dev/null)"
@gfguthrie
gfguthrie / .zshrc
Created September 27, 2019 22:02
Lazy Load Homebrew NVM but still have default aliased Node in PATH
# normal brew nvm shell config lines minus the 2nd one
# lazy loading the bash completions does not save us meaningful shell startup time, so we won't do it
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion" # This loads nvm bash_completion
# add our default nvm node (`nvm alias default 10.16.0`) to path without loading nvm
export PATH="$NVM_DIR/versions/node/v$(<$NVM_DIR/alias/default)/bin:$PATH"
# alias `nvm` to this one liner lazy load of the normal nvm script
alias nvm="unalias nvm; [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"; nvm $@"
@tjvr
tjvr / compile.js
Last active September 27, 2019 16:10
compile a moo lexer
const moo = require('moo')
function compileClass(constructor, indent) {
let s = ''
s += indent + 'var ' + constructor.name + ' = ' + constructor
for (let key in constructor.prototype) {
s += '\n\n'
const value = constructor.prototype[key]
if (typeof value === 'function') {
s += indent + constructor.name + '.prototype.' + key + ' = ' + value
function logColor(color, args) {
console.log(`%c ${args.join(' ')}`, `color: ${color}`);
}
const log = {
aliceblue: (...args) => { logColor('aliceblue', args)},
antiquewhite: (...args) => { logColor('antiquewhite', args)},
aqua: (...args) => { logColor('aqua', args)},
aquamarine: (...args) => { logColor('aquamarine', args)},
azure: (...args) => { logColor('azure', args)},
@pejalo
pejalo / post.js
Last active November 13, 2022 09:47
Firebase function for dynamic routing via redirect
const admin = require('firebase-admin');
function buildHtmlWithPost (post) {
const title = post.title + ' | Example Website';
var head = {
title: title,
meta: [
// This may not be a valid combination of tags for the services you need to support;
@atmd83
atmd83 / background-1.js
Last active October 31, 2022 14:11
Demo for cross-extension messaging in chrome extensions
chrome.runtime.onMessageExternal.addListener(function(request, sender, sendResponse) {
console.log('incomming');
if (request.getTargetData){
console.log('We have target data');
sendResponse({targetData: {}});
} else {
if (request.activateLasers) {
var success = true;
console.log('lazers active');
sendResponse({activateLasers: success});
@yvele
yvele / get-npm-package-version.sh
Last active April 27, 2024 04:19
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g' \
| tr -d '[[:space:]]')
echo $PACKAGE_VERSION