Skip to content

Instantly share code, notes, and snippets.

View arondeparon's full-sized avatar
馃

Aron Rotteveel arondeparon

馃
View GitHub Profile
@arondeparon
arondeparon / ValidateAtLeastOne.php
Created July 14, 2016 08:22
Laraval Custom Validator to validate that at least one item in an array is filled
Validator::extend('at_least_one_filled', function($attribute, $value, $parameters, $validator) {
if (is_array($value)) {
$filteredArray = array_filter($value);
return count($filteredArray) > 0;
} else {
return !empty($value);
}
});
@arondeparon
arondeparon / gist:5b844c9fa5c85ca3f6f30507b659dcb6
Created December 12, 2018 09:34
Turn off dark mode for Microsoft Office on Mac
# So, Microsoft made their Office suite dark-mode compatible, sort of.
# Thing is, it looks absolutely terrible and there is no simple way to turn it off.
# Oh wait, there is! Paste these commands in your terminal to excempt the app from Dark Mode in Mac OS.
defaults write com.microsoft.Excel NSRequiresAquaSystemAppearance -bool yes
defaults write com.microsoft.Word NSRequiresAquaSystemAppearance -bool yes
defaults write com.microsoft.Outlook NSRequiresAquaSystemAppearance -bool yes
defaults write com.microsoft.Powerpoint NSRequiresAquaSystemAppearance -bool yes
@arondeparon
arondeparon / ThemosisValetDriver.php
Created June 2, 2020 15:40
Themosis Laravel Valet Driver
<?php
class ThemosisValetDriver extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@arondeparon
arondeparon / ai.sh
Last active November 11, 2024 11:58
Simple ChatGPT CLI wrapper
#!/bin/bash
# Set your OpenAI API key
OPENAI_API_KEY=
# Initialize input variable
input=""
# Determine input source: stdin or command-line argument
if [ -p /dev/stdin ]; then