Skip to content

Instantly share code, notes, and snippets.

@vianneychin
vianneychin / CommentCollection.php
Created April 8, 2025 18:55
Some of my favorite Laravel code that I've written recently:
<?php
// A custom upsert method that I've implemented that both handles mass insert in one query as opposed to many.
// The Laravel upsert only returns a boolean so I've added a custom flag that allows you to return the data that was just upserted.
/**
* Handles upserting CommentCollections with option to return upserted data
*
* @param array $collectionsToUpsert Array of comment collections data to upsert
* @param bool $returnUpsertedData Whether to return the upserted records
@vianneychin
vianneychin / com.googlecode.iterm2.plist
Last active September 19, 2024 07:48
iTerm2 preferences and keybindings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
<key>ApplePressAndHoldEnabled</key>
<false/>
<key>AppleScrollAnimationEnabled</key>
<integer>0</integer>
@vianneychin
vianneychin / .aerospace.toml
Last active September 19, 2024 07:49
Aerospace config for MacOS window manager
# Reference: https://github.com/i3/i3/blob/next/etc/config
# i3 doesn't have "normalizations" feature that why we disable them here.
# But the feature is very helpful.
# Normalizations eliminate all sorts of weird tree configurations that don't make sense.
# Give normalizations a chance and enable them back.
enable-normalization-flatten-containers = false
enable-normalization-opposite-orientation-for-nested-containers = false
# Mouse follows focus when focused monitor changes
{"lastUpload":"2021-08-11T04:12:25.271Z","extensionVersion":"v3.4.3"}