Skip to content

Instantly share code, notes, and snippets.

View hsimah's full-sized avatar

hsimah

View GitHub Profile
# Join-Path will handle trailing slashes or lack thereof
Join-Path -Path $Branch -ChildPath $Leaf
# Other useful functions include:
[IO.Path]::GetDirectoryName() # Gets the directory name
[IO.Path]::GetFileName() # Gets the file name
[IO.Path]::GetFileNameWithoutExtension() # Gets the file name sans extension
[IO.Path]::GetExtension() # Gets the file extension including leading .
function Move-ByDate {
param(
$Path = '.',
$Destination
)
Get-ChildItem -Path $Path | ForEach-Object {
$Date = $_.LastWriteTimeUtc | Get-Date -f yyyy.M
$DestPath = Join-Path $Destination $Date
@hsimah
hsimah / karabiner.json
Last active December 18, 2019 18:03
[WIP] OS X keybindings - system and vs code
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@hsimah
hsimah / PowerShellMenu.cs
Created May 16, 2020 23:26
PowerShell interactive menu
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Management.Automation;
namespace ProjectShell.Startup
{
enum ActionType
{
@hsimah
hsimah / Dockerfile
Last active September 6, 2020 20:56
Initial Dockerfile for WordPress, WSL2 & Docker
########################################################################
# Pre-configured WordPress Installation for local PHP/node development #
# For development & testing only, use in production not recommended. #
########################################################################
FROM wordpress:latest
LABEL author=hsimah
LABEL author_uri=https://github.com/hsimah-services
@hsimah
hsimah / docker-compose.yml
Created September 6, 2020 20:38
Initial docker-compose.yml for WordPress, WSL2 & Docker
version: "3.7"
services:
wordpress:
container_name: www
build:
context: .
dockerfile: ./Dockerfile
links:
- mysql
@hsimah
hsimah / docker-compose.yml
Last active September 6, 2020 20:54
Add wp-content to docker-compose.yml for WordPress, WSL2 & Docker
version: "3.7"
services:
wordpress:
container_name: www
build:
context: .
dockerfile: ./Dockerfile
links:
- mysql
@hsimah
hsimah / docker-compose.yml
Last active September 6, 2020 20:57
Node-ready docker-compose.yml for WordPress, WSL2 & Docker
version: "3.7"
services:
wordpress:
container_name: www
build:
context: .
dockerfile: ./Dockerfile
links:
- mysql
@hsimah
hsimah / Dockerfile
Created September 6, 2020 20:58
Node-react Dockerfile for WordPress, WSL2 & Docker
########################################################################
# Pre-configured WordPress Installation for local PHP/node development #
# For development & testing only, use in production not recommended. #
########################################################################
FROM wordpress:latest
LABEL author=hsimah
LABEL author_uri=https://github.com/hsimah-services
@hsimah
hsimah / .bashrc
Created September 6, 2020 21:05
.bashrc for WordPress, WSL2 & Docker
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000