Skip to content

Instantly share code, notes, and snippets.

@younesbelkada
younesbelkada / finetune_llama_v2.py
Last active May 3, 2024 19:01
Fine tune Llama v2 models on Guanaco Dataset
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@ciiqr
ciiqr / zod-optional-null.ts
Last active May 3, 2024 19:01
zod optional/nullable/nullish differences
// zod schema
z.object({
// valid if string or:
optional: z.string().optional(), // field not provided, or explicitly `undefined`
nullable: z.string().nullable(), // field explicitly `null`
nullish: z.string().nullish(), // field not provided, explicitly `null`, or explicitly `undefined`
});
// type
{
@protrolium
protrolium / ffmpeg.md
Last active May 3, 2024 18:58
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@dippa-1
dippa-1 / combine_git_repos.sh
Last active May 3, 2024 18:57
Combine many git repos into one
# Use-case:
# - We have multiple git repositories but want to merge them together for simplicity / using a monorepo / etc.
# - We can not lose the git history and tags
# - The new structure can be arbitrary
#
# Solution:
# - Create a tmp directory and clone all previous repos
# - Install git filter-repo via pip
# - In each of these repos, use the git filter-repo command to move all files to any new directory inside the repository
# - cd anywhere and create your new repository
@AndnixSH
AndnixSH / xorg.conf
Last active May 3, 2024 18:54
This config allows you to start desktop environment and enable GPU acceleration without monitor connected. Official Nvidia driver is required if you use Nvidia card. NO DUMMY DISPLAY PLUGS REQUIRED
# By default, desktop environment won't start unless you connect your monitor
# This config allows you to start desktop environment and enable GPU acceleration without monitor connected. Official Nvidia driver is required if you use Nvidia card.
# NO DUMMY DISPLAY PLUGS REQUIRED
# Save the file to /etc/X11/xorg.conf
# Disable "Allow Flipping" in Nvidia settings to fix desktop flickering
# Tested on Linux Mint 21 with AnyDesk remote desktop
# GPU: NVIDIA GeForce GT 710
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
@Klerith
Klerith / pasos-node-typescript.md
Last active May 3, 2024 18:54
Configurar proyecto de Node con TypeScript

Pasos para usar Node con TypeScript con Nodemon

Más información - Docs Oficiales

  1. Instalar TypeScript y tipos de Node, como dependencia de desarrollo
npm i -D typescript @types/node
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)
# This xorg configuration file will start a dummy X11 server.
# move it to /etc/X11/xorg.conf
# don't forget apt install xserver-xorg-video-dummy;
# based on https://xpra.org/Xdummy.html
Section "ServerFlags"
Option "DontVTSwitch" "true"
Option "AllowMouseOpenFail" "true"
Option "PciForceNone" "true"
Option "AutoEnableDevices" "false"
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 18:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@JeffPaine
JeffPaine / i3-cheat-sheet.md
Last active May 3, 2024 18:44
i3 Window Manager Cheat Sheet

i3 Window Manager Cheat Sheet

$mod refers to the modifier key (alt by default)

General

  • startx i3 start i3 from command line
  • $mod+<Enter> open a terminal
  • $mod+d open dmenu (text based program launcher)
  • $mod+r resize mode ( or to leave resize mode)
  • $mod+shift+e exit i3
@bmaupin
bmaupin / free-database-hosting.md
Last active May 3, 2024 18:38
Free database hosting