Skip to content

Instantly share code, notes, and snippets.

@padeoe
padeoe / README_hfd.md
Last active May 11, 2024 08:08
CLI-Tool for download Huggingface models and datasets with aria2/wget+git

🤗Huggingface Model Downloader

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, this command-line tool smartly utilizes wget or aria2 for LFS files and git clone for the rest.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
  • 🚀 Multi-threaded Download: Utilize multiple threads to speed up the download process.
  • 🚫 File Exclusion: Use --exclude or --include to skip or specify files, save time for models with duplicate formats (e.g., *.bin or *.safetensors).
  • 🔐 Auth Support: For gated models that require Huggingface login, use --hf_username and --hf_token to authenticate.
  • 🪞 Mirror Site Support: Set up with HF_ENDPOINT environment variable.
@damien-biasotto
damien-biasotto / setup-guide.org
Created March 29, 2024 04:43
Setup NixOS on Macbook w/ Apple Silicon Chip (LUKS + LVM + BTRFS)

A guide to setup NixOS with LUKS and BTRFS on a MacBook Pro

This is mostly a dumping of my thoughts and steps I had to go to setup my macbook with NixOS.

I cannot guarantee the accuracy of the information and nor being held accountable to any issue if somehow this guide ends up on the internet.

@dragonfire1119
dragonfire1119 / n8n-docker-compose
Last active May 11, 2024 07:57
Docker compose for n8n.io
version: '3'
services:
n8n:
image: docker.n8n.io/n8nio/n8n
ports:
- 5678:5678
environment:
- GENERIC_TIMEZONE=America/Chicago
- TZ=America/Chicago
@theKAKAN
theKAKAN / SELLERS.md
Created April 20, 2024 19:48
List of alternatives to amazon/flipkart and such
@kyaroru
kyaroru / expo-config-plugin-modify-pod.ts
Last active May 11, 2024 07:52
Example of expo config plugin for modifying Podfile
import { ConfigPlugin, withDangerousMod } from '@expo/config-plugins'
import {
MergeResults,
mergeContents,
removeContents,
} from '@expo/config-plugins/build/utils/generateCode'
import path from 'path'
import fs from 'fs-extra'
const debug = require('debug')('file-viewer-plugin') as typeof console.log
@evantoli
evantoli / GitConfigHttpProxy.md
Last active May 11, 2024 07:51
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@fritzvd
fritzvd / basic.py
Created April 12, 2016 14:38
Live streaming of stdout over udp with ansible // based on: http://rferrer.me/articles/live-ansible-stdout.html
import socket
# Add a custom listener to read out stdout
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
while True:
rfd, wfd, efd = select.select(rpipes, [], rpipes, 1)
if cmd.stdout in rfd:
dat = os.read(cmd.stdout.fileno(), 9000)
stdout += dat
sock.sendto(dat, ("127.0.0.1", 9876)) # append to listener
@wojteklu
wojteklu / clean_code.md
Last active May 11, 2024 07:48
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@andsve
andsve / app_delegate.c
Created January 17, 2019 13:36
A simple implementation of a NSApplicationDelegate and two methods (openFile:, openFiles:) in pure C.
/*
app_delegate.c
1. Compile and link with:
$ clang -g -o AppInC app_delegate.c -lobjc -framework Foundation -framework AppKit -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
2. Create a Info.plist with:
[[
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?