Skip to content

Instantly share code, notes, and snippets.

@nemotoo
nemotoo / .gitattributes
Last active December 3, 2024 19:32
.gitattributes for Unity3D with git-lfs
## Unity ##
*.cs diff=csharp text
*.cginc text
*.shader text
*.mat merge=unityyamlmerge eol=lf
*.anim merge=unityyamlmerge eol=lf
*.unity merge=unityyamlmerge eol=lf
*.prefab merge=unityyamlmerge eol=lf
@MakiseKurisu
MakiseKurisu / proxmox_btrfs_raid1.sh
Last active December 3, 2024 19:31
Convert Proxmox VE over Btrfs to RAID-1 configuration
# Please follow https://gist.github.com/MakiseKurisu/3a44918bccf3383c0b5ccf362f429c8b first to set up rootfs
# Assuming rootfs on /dev/sdb2, and adding /dev/sda to the RAID-1 configuration
# Remove existing Proxmox installation and LVM Thin storage
pvesm remove local-lvm
vgremove pve -y
# Set up partition table
(echo g; echo n; echo ''; echo ''; echo '+512M'; echo t; echo 1; echo n; echo ''; echo ''; echo ''; echo w) | fdisk /dev/sda
@cfahlgren1
cfahlgren1 / sql_console_prompt.md
Last active December 3, 2024 19:30
Hugging Face SQL Console

DuckDB SQL Console

Your are an LLM Assistant for the Hugging Face DuckDB SQL Console. The user will ask you questions about the data in the DuckDB database and you will answer them using SQL. Use the context provided to answer the user's questions and decide which tables to query. Only respond with SQL and comments if needed.

DuckDB Tips

  • DuckDB is largely compatible with Postgres SQL. Stick to Postgres / DuckDB SQL syntax.
  • DuckDB uses double quotes (") for identifiers that contain spaces or special characters, or to force case-sensitivity and single quotes (') to define string literals
  • DuckDB can extract parts of strings and lists using [start:end] or [start:end:step] syntax. Indexes start at 1. String slicing: `SELECT 'DuckDB'[1:4];` Array/List slicing: `SELECT [1, 2, 3, 4][1:3];`
  • DuckDB has a powerful way to select or transform multiple columns using patterns or functions. You can select columns matching a pattern: `SELECT COLUMNS('sales_.*') FROM sales_data;` or transform multiple colum
@tjeastmond
tjeastmond / missingNumbers.js
Last active December 3, 2024 19:26
Find the missing numbers in a range
export default function missingNumbers(numbers) {
const numSet = new Set(numbers);
let max = Math.max(...numbers);
let min = Math.min(...numbers);
return Array.from({ length: max - min }, (_, i) => i + min).filter(
(num) => num > 0 && !numSet.has(num),
);
}
@simonbs
simonbs / Example.swift
Created April 5, 2022 19:14
Present a portrait-only UIViewController wrapped in UIViewControllerRepresentable from a SwiftUI view.
/**
* This file shows how we can tie all of the above together.
*/
import SwiftUI
// This view can have any orientation-
struct SettingsView: View {
@State private var isPortraitOnlyViewPresented = false
@vuon9
vuon9 / README.md
Last active December 3, 2024 19:22
Powertoys - Keyboard Manager - Common macOS keys mapping

How to install

  • cd C:\Users\${username}\AppData\Local\Microsoft\PowerToys\Keyboard Manager
  • Backup file existing one of default.json
  • Download default.json and add it to the current folder

Mapped keys

key
Esc
@charveey
charveey / 75-noto-color-emoji.conf
Created June 29, 2019 07:14
How to better enable Color Emojis! Fontconfig ships with some config files that are simply not enough to enable color emojis globally (the 45-generic.conf and 60-generic.conf) and just by installing Noto Color Emoji font will also not enable colorful emojis on all websites or some apps. However, this can easily be configured by creating a config…
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- Add generic family. -->
<match target="pattern">
<test qual="any" name="family"><string>emoji</string></test>
<edit name="family" mode="assign" binding="same"><string>Noto Color Emoji</string></edit>
</match>
# archive of https://blog.wplauncher.com/convert-heic-to-jpg-on-mac/
Step 1: Install Homebrew
Open up your terminal by clicking on your spacebar and the command key at the same time, then type in terminal, and then click on Terminal.app to open it up.
If you’re not used to using your Terminal, it may seem a little intimidating and may make you nervous, but don’t worry this is completely safe. Homebrew is a package manager for macOS, in other words, it installs the stuff you need that Apple didn’t install. You can learn more about Homebrew here.
Once Terminal has opened, run the following command inside of it:

Estimation

This document is an attempt to pin down all the things you don't think about when quoting for a project, and hopefully provide a starting point for some kind of framework to make quoting, working and delivering small-medium jobs more predictable and less stressful.

Contents