Skip to content

Instantly share code, notes, and snippets.

1/2/2017
moment().format("M/D/YYYY");
01/02/2017
moment().format("MM/DD/YYYY");
14:57:22
moment().format("HH:mm:ss");
02:57 PM
1/2/2017
DateTime.Now.ToString("M/d/yyyy");
01/02/2017
DateTime.Now.ToString("MM/dd/yyyy");
14:57:22
DateTime.Now.ToString("HH:mm:ss");
02:57 PM
require(__DIR__ . "/vendor/autoload.php");
interface IDog {
function bark();
}
class Poodle implements IDog {
public function bark() {
echo "woof!" . PHP_EOL;
}
@brentk
brentk / .gitconfig
Last active December 19, 2025 16:19
My gitconfig
[user]
name = brentk
email = brenttkelly@gmail.com
[push]
default = simple
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
@brentk
brentk / .vimrc
Last active February 15, 2024 16:54
vim configuration
" Enable syntax highlighting
syntax on
" Set tabs to 4 spaces
set expandtab ts=4 sw=4 ai
" Highlight searched text
set hlsearch
" Solid block cursor (needed for git bash):
@brentk
brentk / vs
Last active September 27, 2021 21:40
Bash script to simplify opening a vs solution from a bash prompt
#!/bin/bash
# Bash script to simplify opening a vs solution from a bash prompt
file=""
fileCount=$(ls *.sln 2> /dev/null | wc -l)
if [ $fileCount -eq "0" ]; then
echo "ERROR: No solution files found."
exit 1
fi
@brentk
brentk / System.ini
Created May 27, 2023 21:26
Rainmeter Config
; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------
[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Author=poiru
AppVersion=2003000
Update=1000
Background=#@#Background.png
@brentk
brentk / docker_cleanup.ps1
Created August 3, 2026 22:27
Docker (Windows) Cleanup
# View space taken up
docker system df -v
# Safe cleanup commands (won't drop anything that is "dangling" because a container is just stopped)
docker image prune
docker builder prune
# PS Function to shrink WSL drive (run as administrator)
function docker_compact {
param(