Skip to content

Instantly share code, notes, and snippets.

@samthor
samthor / dialog-focus-restore.js
Last active December 1, 2023 14:39
Restore focus after a HTML dialog is shown modally
/**
* Updates the passed dialog to retain focus and restore it when the dialog is closed. Won't
* upgrade a dialog more than once. Supports IE11+ and is a no-op otherwise.
* @param {!HTMLDialogElement} dialog to upgrade
*/
var registerFocusRestoreDialog = (function() {
if (!window.WeakMap || !window.MutationObserver) {
return function() {};
}
var registered = new WeakMap();
@wes-goulet
wes-goulet / bootstrap_dev_machine.ps1
Last active July 17, 2018 04:50
powershell commands to run when setting up new windows dev environment
# if you want to run this as a script then you have to make sure
# you've enabled RemoteSigned scripts with:
# Set-ExecutionPolicy RemoteSigned
# To run this script do the following:
# iwr https://gist.githubusercontent.com/wes566/dd90579b6261fc9a1da92857cdbc910e/raw/bootstrap_dev_machine.ps1 -UseBasicParsing | iex
#install chocolatey
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
@wes-goulet
wes-goulet / .bash_aliases
Last active December 22, 2021 19:51
aliases for bash on windows
alias gs='git status'
alias ga='git add --all'
alias gf='git fetch --all --prune'
alias gsu='git submodule sync && git submodule update --init --recursive'
alias repos='cd ~/Source/Repos'
alias sln='start *.sln'
alias startssh='eval `ssh-agent -s` && ssh-add ~/.ssh/id_rsa'
alias gt='echo Fetch then show local tags: && git fetch --tags && git tag -l --sort=v:refname'
alias gtu='echo Fetch upstream then show local tags: && git fetch --tags upstream && git tag -l --sort=v:refname'
alias grt='echo Remote Tags: && git ls-remote --tags | sort -t '"'"'/'"'"' -k 3 -V | awk '"'"'{print $2}'"'"' | grep -v "{}"'
@Chaser324
Chaser324 / GitHub-Forking.md
Last active July 22, 2024 14:45
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j