Skip to content

Instantly share code, notes, and snippets.

@marlosirapuan
marlosirapuan / app-context.ts
Created August 31, 2023 18:09
Context App Provider with zustand in Typescript
import { createContext, useContext } from 'react'
import { createStore, StoreApi } from 'zustand'
import { immer } from 'zustand/middleware/immer'
import { useStoreWithEqualityFn } from 'zustand/traditional'
type State = {
total: number
increase: () => void
decrease: () => void
@bashbunni
bashbunni / .zshrc
Created January 4, 2023 16:28
CLI Pomodoro for Linux
# study stream aliases
# Requires https://github.com/caarlos0/timer to be installed. spd-say should ship with your distro
declare -A pomo_options
pomo_options["work"]="45"
pomo_options["break"]="10"
pomodoro () {
if [ -n "$1" -a -n "${pomo_options["$1"]}" ]; then
val=$1
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 6, 2024 08:30
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@jfeilbach
jfeilbach / gist:18b08ea0ed9eaf844d643ab092905973
Last active May 6, 2024 08:28
tvOS.xml for plex (modified) for use with AppleTV 4k
<?xml version="1.0" encoding="utf-8"?>
<Client name="tvOS">
<!-- Author: Plex Inc. -->
<!-- This profile is used by A10X-based tvOS (Apple TV 4K) devices using the MPV ("experimental") video player. Currently, this requires a Plex Pass subscription. -->
<!-- Because Plex does not currently support TrueHD or DTS-MA playback in the client, this audio is transcoded to FLAC. -->
<Settings>
<Setting name="DirectPlayStreamSelection" value="true" />
<Setting name="StreamUnselectedIncompatibleAudioStreams" value="true" />
</Settings>
<TranscodeTargets>
@DeezNutq
DeezNutq / info.md
Last active May 6, 2024 08:27
AIDA64 keys for all editions (working @ 08.04.2024)

Note : FinalWire, you can keep trying to stop us, but you can't. You know why ? You've been using the same algorithm for 10 years. Changing it would be an inconvenience for you and your customers.

By the way, I'd suggest that you proofread your DMCA requests. If you didn't know, it's "generated" and not "genereated". Also, when referencing to someone's belonging you use the possessive form "their" and not "there".

FOR EDUCATIONAL PURPOSES ONLY, PLEASE SUPPORT THE DEVELOPPERS :)

Check BLACKLISTED for blacklisted keys

@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 6, 2024 08:27
crack activate Office on mac with license file
@DraTeots
DraTeots / ComPort over Network.md
Last active May 6, 2024 08:22
ComPort over Network
@ChxGuillaume
ChxGuillaume / EMQX-and-Traefik.md
Last active May 6, 2024 08:20
Configuring an EMQX instance behind Traefik with ProxyProtocol

EMQX x Traefik

1. Treafik config

docker-compose.yml

services:
  reverse-proxy:
    image: traefik:v2.11