Skip to content

Instantly share code, notes, and snippets.

View justsanjit's full-sized avatar
🏠
Working from home

Sanjit Singh justsanjit

🏠
Working from home
View GitHub Profile
@justsanjit
justsanjit / recursive_require_with_path.ts
Created April 19, 2023 05:43
Typescript mapped type that will accept a nested object and a list of paths to make required.
interface Phone {
number: string
extension?: string
}
interface Person {
firstName?: string;
lastName?: string;
age?: number;
address?: {
@justsanjit
justsanjit / Controller.php
Last active April 19, 2022 22:33
Fuzzy filter for spatie/laravel-query-builder
<?php
$query->allowedSorts('id', 'name')
->allowedFilters(
AllowedFilter::custom('search', new FuzzySearch('name', 'email', 'address.city'))
);
@justsanjit
justsanjit / kiosk.service
Last active June 29, 2019 16:13
Raspberry pi kiosk with chromium
[Unit]
Description=Chromium Kiosk
Wants=graphical.target
After=graphical.target
[Service]
Environment=DISPLAY=:0.0
Environment=XAUTHORITY=/home/pi/.Xauthority
Type=simple
ExecStart=/bin/bash /home/pi/Desktop/kiosk.sh