Skip to content

Instantly share code, notes, and snippets.

😀

Devin Rhode devinrhode2

😀
Block or report user

Report or block devinrhode2

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View global .gitconfig
[core]
excludesfile = ~/.gitignore_global
editor = code --wait
pager = cat
ignorecase = false
[user]
email = devinrhode2@gmail.com
name = devinrhode2
[merge]
tool = code
@devinrhode2
devinrhode2 / answer-to-bens-quiz-question.md
Last active Feb 13, 2020
answer to bens quiz question
View answer-to-bens-quiz-question.md
View How I rebase.md

First, run a vanilla git rebase. Then in vs code... "Undo" all commits you may want to modify. (in git sidebar, there's a "..." button with a ton of git related actions) From here, you would use vscode git diff editor/viewer, and highlight chunks of code to stage. From there it's personal opinion as to exactly how to group the code changes into one or a series of commits.

@devinrhode2
devinrhode2 / dump.md
Created Jan 4, 2020
Some submodule post-checkout and post-merge scripts+dump of submodule notes
View dump.md

In your package.json scripts... add these without newlines/escapes

    "submodulePostCheckoutCorrectDetachedHeads": "
    git submodule sync --recursive &&
    git submodule update --checkout &&
    git submodule foreach \
      'latest_commits_remote_branch=$(\
        git branch -r --contains `git log -1 --pretty=format:\"%h\"`
       ) node $toplevel/dev-scripts/checkout_right_branch $sm_path'", // end submodule post-checkout
    "submodulePostMergeUpdateSubmoduleMerge": "
@devinrhode2
devinrhode2 / cloudSettings
Last active Dec 19, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-12-19T01:11:36.136Z","extensionVersion":"v3.4.3"}
View Always securely use square brackets.js
// WORK IN PROGRESS...
const safeGet = (obj, key) => {
if (obj[key] == null) obj[key];
if (typeof obj[key] === 'function') {
throw new Error('Cannot safely get '+key+' since it a function. Use square bracket syntax to directly access instead.');
}
if (Object.prototype.hasOwnProperty.call(obj, key)) {
return obj[key];
} else {
// This console log could be rather buggy:
@devinrhode2
devinrhode2 / emuparadise.download.user.js
Created Sep 29, 2019 — forked from infval/emuparadise.download.user.js
emuparadise.me download workaround (Most games + Sega Dreamcast, Books/Comics/Guides/Magazines)
View emuparadise.download.user.js
// ==UserScript==
// @name EmuParadise Download Workaround
// @version 1.2.2
// @description Replaces the download button link with a working one
// @author infval (Eptun)
// @match https://www.emuparadise.me/*/*/*
// @grant none
// ==/UserScript==
// https://www.reddit.com/r/Piracy/comments/968sm6/a_script_for_easy_downloading_of_emuparadise_roms/
@devinrhode2
devinrhode2 / get-env-var.js
Last active Sep 25, 2019
attempt to try and change environment variables used in .eslintrc.js for CRA dev server without restarting the dev server
View get-env-var.js
/* Usage:
const initGetEnv = require('./dev-scripts/get-env-var.js');
const env = initGetEnv({
useLiveEnv: typeof process.env.USE_LIVE_ENV !== 'undefined'
});
if (env('foobar')) doSomething();
// The idea is that you'd be able to change variables on the fly by editing the .env.live file.
View getIEVersionInt
formatting for 1st answer on https://stackoverflow.com/questions/31757852/how-can-i-detect-internet-explorer-ie-and-microsoft-edge-using-javascript/32107845
const ieVersionInt = (function getIEVersionInt(){
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer') {
let ua = navigator.userAgent,
re = new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})");
if (re.exec(ua) !== null){
@devinrhode2
devinrhode2 / .zshrc
Created Apr 18, 2019
highlights from my zshrc
View .zshrc
## INSTALLATION
# Make this your ~/.zshrc file and make sure to do the zgen install steps here:
# https://github.com/tarjoilija/zgen#installation
# You'll also need to change the default shell to zsh: https://github.com/robbyrussell/oh-my-zsh#4-change-your-default-shell
export PATH=$PATH:/Users/rhoded/Desktop/Archive2/Visual\ Studio\ Code.app/Contents/Resources/app/bin
ulimit -n 10240 unlimited
export HOMEBREW_NO_ANALYTICS=1
You can’t perform that action at this time.