Skip to content

Instantly share code, notes, and snippets.

@cobyism
cobyism / gh-pages-deploy.md
Last active May 3, 2024 19:07
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@adog1314
adog1314 / PortForwardOverWireGuard.md
Last active May 3, 2024 19:03
Port forward over wireguard to VPS with static IP

Port forward over wireguard to VPS with static IP

This is write up is on how to port forward over wireguard. I am going to be port forwarding a mail server running MailCow on my local server, but really any service can be port forwared with some modifications to the IPTables commands in the wireguard file.

I am using a cheap Vultr VPS as my proxy server, if your intrested heres a referral link https://www.vultr.com/?ref=9019507 where I get $10 or if you plan to spend more then $35 on your account you will get $100 and I will get $35 https://www.vultr.com/?ref=9019508-8H

My Setup

  • Debain 10 Buster
  • Tunnel subnet: 10.1.1.0
  • Proxy-VPS Tunnel IP: 10.1.1.1
@robweber
robweber / update_godaddy_dns.py
Last active May 3, 2024 19:02
Use the GoDaddy API to update a DNS record when external IP changes
"""update_godaddy_dns.py
Updates a GoDaddy DNS record with a new external IP address using the GoDaddy API
Run in debug mode (-D) to check the IP but not update DNS records
https://developer.godaddy.com/doc/endpoint/domains
Requires:
configargparse
requests
"""
@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)