Skip to content

Instantly share code, notes, and snippets.

View martanto's full-sized avatar
👋
Hai!

Martanto martanto

👋
Hai!
View GitHub Profile
@ECHO OFF
TITLE Generate A New AnyDesk ID
@ECHO Disabling the AnyDesk service...
SC.exe stop AnyDesk >NUL 2>&1
SC.exe failure AnyDesk reset= 86400 actions= // >NUL 2>&1
import { z } from 'zod'
import { mapValues, omit, pick } from 'lodash'
function partialSafeParse<Schema extends z.ZodObject<any>> ( schema: Schema, input: unknown ) {
const result = schema.safeParse( input )
if ( result.success ) return result
const { fieldErrors, formErrors } = result.error.flatten()
if ( formErrors.length ) return result
@odan
odan / nginx-php-windows-setup.md
Last active July 30, 2025 08:18
Nginx and PHP Setup on Windows

Nginx and PHP Setup on Windows

For local development you could also use Nginx with PHP as an replacement for XAMPP.

Install Nginx

import ruamel.yaml
import argparse
parser = argparse.ArgumentParser(description='(anaconda) environment.yml -> (pip) requirements.txt')
parser.add_argument('environment_yml_file', type=str, metavar='environment.yml', default='environment.yml', help='the input file')
parser.add_argument('-o', type=str, metavar='requirements.txt', default=None, help='the output file')
args = parser.parse_args()
basepath = args.environment_yml_file.replace("\\",'/').rsplit('/', maxsplit=1)[0]
out_file = args.o
if out_file == None:
@sistematico
sistematico / nginx.conf
Last active May 12, 2025 07:39
Windows 10 + Nginx + PHP FastCGI Service
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
@jhoff
jhoff / Enums.php
Last active July 20, 2025 00:04
Laravel Model Enumeration Trait
<?php
namespace App\Traits;
use Illuminate\Support\Str;
use App\Exceptions\InvalidEnumException;
trait Enums
{
/**