Skip to content

Instantly share code, notes, and snippets.

@padeoe
padeoe / README_hfd.md
Last active April 20, 2024 02:20
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.
@DraTeots
DraTeots / ComPort over Network.md
Last active April 20, 2024 02:17
ComPort over Network
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 20, 2024 02:15
set -e, -u, -o, -x pipefail explanation
@arkatsy
arkatsy / zustand-internals.jsx
Last active April 20, 2024 02:12
How zustand works internally
import { useSyncExternalStore } from "react";
// For more on the useSyncExternalStore hook, see https://react.dev/reference/react/useSyncExternalStore
// The code is almost identical to the source code of zustand, without types and some features stripped out.
// Check the links to see the references in the source code.
// The links are referencing the v5 of the library. If you plan on reading the source code yourself v5 is the best way to start.
// The current v4 version contains lot of deprecated code and extra stuff that makes it hard to reason about if you're new to this.
// https://github.com/pmndrs/zustand/blob/fe47d3e6c6671dbfb9856fda52cb5a3a855d97a6/src/vanilla.ts#L57-L94
function createStore(createState) {
@uncenter
uncenter / macos-app-icon-template.md
Last active April 20, 2024 02:11
SVG template for creating macOS app icons.

macOS App Icon Template

Pretty simple to use - download the attached template.svg file, bring in your logo or icon, resize it to the dimensions of the red square (and delete the red square).

@GitHubStuff
GitHubStuff / README_template.md
Created April 20, 2024 02:10
README.md template

Title

Brief tag line/description

Features

  • Feature
  • Feature

Getting Started

@Blindtechagent
Blindtechagent / index.html
Created January 24, 2022 03:30
WhatsApp message me link generator
<div id="app">
<div class="container">
<div class="row">
<div class="col-sm-12">
<h1>Generate a WhatsApp link</h1>
<p>This little helper will generate a whatsapp message link to use in your <a href="https://htmlsig.com">htmlsig.com</a> email signature social icons or other social posts. </p>
</div>
</div>
@maxfenton
maxfenton / books.md
Last active April 20, 2024 02:02
Books I finished reading

Books I finished reading

in 2024

  • Kitchen Confidential (Audiobook) - Anthony Bourdain
  • The Hulk: Grand Design - Jim Rugg

in 2023

  • The Human Target - Tom King, Greg Smallwood
  • Ways of Being (Audiobook) - James Bridle
  • The Collected Stories of Philip K. Dick - Volume 3: Second Variety - Philip K. Dick

Henry Challenge

Algoritmos y pseudocódigo

Un algoritmo es un proceso para resolver un problema, define las acciones y en qué orden tenes que ejecutarlas.

Pseudocódigo es un lenguaje informal en el que expresamos las instrucciones que definen un Algoritmo. Este utiliza las convenciones estructurales de un lenguaje de programacion real, pero es más fácil leerlo para un humano que para una computadora. No existe una síntaxis estandar para el pseudocodigo, en nuestros ejemplos vamos a usar un subgrupo de instrucciones:

  • Variables: vamos a poder definir variables y darle valores. Podemos usar cualquier nombre para las variables y luego referinos a ellas con esos nombres: