Skip to content

Instantly share code, notes, and snippets.

@ben-mohrbacher
ben-mohrbacher / .gitmessage
Created May 20, 2024 14:47
A git commit message template
<your-ticket-prefix>
# Subject Line
# ======================================================================
#
# One line less than 72 characters in length. Generally focused on the
# "What" rather than the "Why".
#
# Format <tag>: <message>
#
# `tag`: can be either a defined list of tags like "Add", "Remove",

Windows 10 - Using Git Bash With TMUX

Why Not Use WSL?

I tried the WSL and it isn't quite seamless enough for me. I ran in to problems when editing in VSCode and having watchers on my files (ng serve, dotnet watch run, etc.). In addition, I kept running in to problems that only manifest themselves when running in WSL. For example, this issue with doing production builds and the terser plugin has made many a developer rage-quit on using WSL. Just figuring out that it was an issue with the WSL took a lot of time.

That terser plugin issue was never resolved and I ended up having to keep a git bash window open in addition to my WSL console window so I could do production builds. To make matters worse, my npm packages were platform-dependent so I couldn't use the same project folder. So, my procedure was: commit whatever changes to test branch, push to repo, git pull on my "windows" project folder, and do a production build there

@fatbobman
fatbobman / keyboardAvoiding.swift
Created May 13, 2024 03:49
keyboardAvoiding for List
// by klaytonb
// https://forums.developer.apple.com/forums/thread/699111?answerId=740437022#740437022
import Combine
import SwiftUI
public extension Publishers {
static var keyboardHeight: AnyPublisher<CGFloat, Never> {
let willShow = NotificationCenter.default.publisher(for: UIApplication.keyboardWillShowNotification)
.map { $0.keyboardHeight }
let willHide = NotificationCenter.default.publisher(for: UIApplication.keyboardWillHideNotification)
@padeoe
padeoe / README_hfd.md
Last active May 21, 2024 06:04
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.
@miketwenty1
miketwenty1 / Cargo.toml
Last active May 21, 2024 06:03
Bevy + Reqwest + WASM target Example
[package]
name = "somepackagename"
version = "0.1.0"
edition = "2021"
[dependencies]
bevy = { version = "0.9" } #, features = ["dynamic"] }
bevy-inspector-egui = "0.14"
wasm-bindgen = "0.2"
reqwest = { version = "0.11", features = ["json"] }

Build a Hyper-converged Proxmox HA Cluster with Ceph

Part of collection: Hyper-converged Homelab with Proxmox

This is part 1 focussing on the networking part of building a Proxmox High Available cluster with Ceph.

Part 2 focusses on building the Proxmox Cluster and setting up Ceph itself, and part 3 focussing on Managing and Troubleshooting Proxmox and Ceph.

Why

For some time, I was looking for options to build a Hyper-converged (HCI) Homelab, considering options like TrueNAS Scale, SUSE Harvester) among other option.

@Denkong
Denkong / SQL - блокировки, транзакции
Created November 22, 2018 15:53
SQL - блокировки, транзакции
===SQL====
Транзакция — это операция, состоящая из одного или нескольких запросов к базе данных.
Суть транзакций — обеспечить корректное выполнение всех запросов в рамках одной транзакции,
а так-же обеспечить механизм изоляции транзакций друг от друга для решения проблемы совместного доступа к данным.
set autocommit=0; //отключаем autocommit
Start transaction; (также, можно написать BEGIN; )
Select * from table where ... FOR UPDATE; // блокирует записаь, снимается после commit
…какие-то действий с БД (insert, update,delete…)
@BookGin
BookGin / 臺灣學術倫理教育資源中心 台灣學術倫理教育資訊中心 題庫 答案 解答 .txt
Last active May 21, 2024 06:00
學術倫理 解答,臺灣學術倫理教育資源中心 台灣學術倫理教育資訊中心 題庫 答案 解答 ,請大家留言補充更多解答 或是修正答案 感謝!
使用方法:Ctrl + F 直接輸入題目關鍵字搜尋即可
請大家留言補充更多解答 或是修正答案,感謝各位的貢獻!
臺灣學術倫理教育資源中心
https://ethics.moe.edu.tw/exam/
其他資源:

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create Free AWS Account

Create free AWS Account at https://aws.amazon.com/

2. Create and Lauch an EC2 instance and SSH into machine

I would be creating a t2.medium ubuntu machine for this demo.

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active May 21, 2024 05:57 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy