Skip to content

Instantly share code, notes, and snippets.

@wes-goulet
wes-goulet / css-grid-example.css
Created July 26, 2018 17:07
CSS Grid Example
.container {
height: 100%;
display: grid;
grid-gap: 3px;
grid-template-columns: repeat(12, 1fr);
grid-template-rows: 40px auto 40px;
grid-template-areas:
"h h h h h h h h h h h h"
"m c c c c c c c c c c c"
"f f f f f f f f f f f f";
# manually install xcode from app store, launch it so EULA is accepted, install additional tools/CLI tools if asked
# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install rectangle (window manager)
brew cask install rectangle
@wes-goulet
wes-goulet / common-git-commands.sh
Created February 20, 2018 18:59
Some commonly used git commands
######################################## Remove all traces of a submodule
# from https://stackoverflow.com/a/36593218
# Remove the submodule entry from .git/config
git submodule deinit -f path/to/submodule
# Remove the submodule directory from the superproject's .git/modules directory
rm -rf .git/modules/path/to/submodule
# Remove the entry in .gitmodules and remove the submodule directory located at path/to/submodule
@wes-goulet
wes-goulet / convertMovToGif.sh
Last active September 6, 2018 15:44
converts an mov to gif using ffmpeg on macos
# use gifify to output at 400px width (maintain aspect ratio)
brew install gifify
gifify -p 400:-1 esc-key.mov
### OLD - looks pixelated
# from https://superuser.com/a/436109 - see that link for optimized version as well
ffmpeg -i yesbuddy.mov -pix_fmt rgb24 output.gif
git config --global alias.ll "log --oneline --decorate --graph --all"
@wes-goulet
wes-goulet / keybindings.json
Last active January 3, 2022 18:05
VS Code custom key bindings for MacOS
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "shift+cmd+s",
"command": "workbench.action.files.saveAll"
},
{
"key": "shift+cmd+s",
"command": "-workbench.action.files.saveAs"
},
set completion-ignore-case On
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
# you must install bash completion with "brew install bash-completion"
[ -f /usr/local/etc/bash_completion ] && . /usr/local/etc/bash_completion
@wes-goulet
wes-goulet / ConvertAllSvgsToPdf.sh
Created November 9, 2017 18:45
Converts all .svg files to .pdf files using Inkscape in the current directory
#! /usr/bin/env bash
svgFiles=$(ls -d -1 $PWD/*.svg)
for file in $svgFiles
do
pdfName=${file/".svg"/".pdf"}
echo "Converting $file to $pdfName"
/Applications/Inkscape.app/Contents/Resources/bin/inkscape --without-gui --file=$file --export-pdf=$pdfName
done
/// <summary>
/// Provides a way to override the current <see cref="implementation"/>.
/// </summary>
/// <param name="valueFactory">Factory that creates the new implementation</param>
/// <param name="implementation">Reference to the current implementation, it will be
/// updated with the new <see cref="valueFactory"/>.</param>
/// <param name="lazyLoad">Set to true if you want to lazy load your new implementation
/// (not recommended if your implementation listens for events in it's constructor).</param>
public static void OverrideDefault<TInterface>(Func<TInterface> valueFactory, ref Lazy<TInterface> implementation, bool lazyLoad = false)
{