Skip to content

Instantly share code, notes, and snippets.

@mfenniak
mfenniak / immich.nix
Last active May 4, 2024 12:40
NixOS configuration for Immich, based upon upstream docker-compose.yml
{ config, ... }:
let
immichHost = "immich.example.com"; # TODO: put your immich domain name here
immichRoot = "/tank/immich"; # TODO: Tweak these to your desired storage locations
immichPhotos = "${immichRoot}/photos";
immichAppdataRoot = "${immichRoot}/appdata";
immichVersion = "release";
immichExternalVolume1 = "/tank/BackupData/Google Photos/someone@example.com"; # TODO: if external volumes are desired
@bib0x
bib0x / immich.nix
Created April 28, 2024 18:33 — forked from mfenniak/immich.nix
NixOS configuration for Immich, based upon upstream docker-compose.yml
{ config, ... }:
let
immichHost = "immich.example.com"; # TODO: put your immich domain name here
immichRoot = "/tank/immich"; # TODO: Tweak these to your desired storage locations
immichPhotos = "${immichRoot}/photos";
immichAppdataRoot = "${immichRoot}/appdata";
immichVersion = "release";
immichExternalVolume1 = "/tank/BackupData/Google Photos/someone@example.com"; # TODO: if external volumes are desired
@qoomon
qoomon / conventional_commit_messages.md
Last active May 4, 2024 12:39
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@heysanil
heysanil / unhide-files.sh
Created March 13, 2024 02:00
Bash script to recursively hide all files in a directory and its subdirectories
#!/bin/bash
# Function to recursively process files and folders
process_directory() {
local directory="$1"
# Loop through each item in the directory
for item in "$directory"/*; do
# Check if the item is a file
if [[ -f "$item" ]]; then
QMA 4 GEM 2007/01/11
IIDX GOLD GLD 2007/02/21
pop'n 15 G15 2007/04/25
Otomedius GGG 2007/11/02
DJ Troopers HDD 2007/12/19
QMA 5 HAL 2008/01/12
pop'n 16 H16 2008/03/24
Horseriders G23 2008/04/09
GFDM V5 H32/H33 2008/06/18
Empress I00 2008/11/19
@gaearon
gaearon / 00-README-NEXT-SPA.md
Last active May 4, 2024 12:36
Next.js SPA example with dynamic client-only routing and static hosting

Next.js client-only SPA example

Made this example to show how to use Next.js router for a 100% SPA (no JS server) app.

You use Next.js router like normally, but don't define getStaticProps and such. Instead you do client-only fetching with swr, react-query, or similar methods.

You can generate HTML fallback for the page if there's something meaningful to show before you "know" the params. (Remember, HTML is static, so it can't respond to dynamic query. But it can be different per route.)

Don't like Next? Here's how to do the same in Gatsby.

Transparent Restaurant Backend

In this task, you're going to implement a REST API for a interacting with a menu of a restaurant. The menu is given to you as a JSON file which you will parse and perform operations on. The required features will be listed below.

Description

In this restaurant, honesty is extremely promoted. So extreme, that the restaurant declares that differing quality of ingredients are used in their meals. Like that's not enough, it also allows the customers to choose the ingredients of each meal in different qualities. Each ingredient has the following quality levels:

  • low: the cheapest
  • medium: moderate
@phatblat
phatblat / AppDelegate.swift
Last active May 4, 2024 12:34
Example of creating HKObserverQuery and enabling background delivery for multiple HKObjectType
@UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate {
let healthKitManager = HealthKitManager()
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
if onboardingComplete {
healthKitManager.requestAccessWithCompletion() { success, error in
if success { print("HealthKit access granted") }
else { print("Error requesting access to HealthKit: \(error)") }
}
@moskomule
moskomule / tinyimagenet.sh
Created November 6, 2017 10:48
tiny imagenet downloader
#!/bin/bash
# download and unzip dataset
#wget http://cs231n.stanford.edu/tiny-imagenet-200.zip
unzip tiny-imagenet-200.zip
current="$(pwd)/tiny-imagenet-200"
# training data
cd $current/train