Skip to content

Instantly share code, notes, and snippets.

View devinrhode2's full-sized avatar
😀

Devin Rhode devinrhode2

😀
View GitHub Profile
@devinrhode2
devinrhode2 / emuparadise.download.user.js
Created September 29, 2019 04:21 — forked from infval/emuparadise.download.user.js
emuparadise.me download workaround (Most games + Sega Dreamcast, Books/Comics/Guides/Magazines)
// ==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 September 25, 2019 16:55
attempt to try and change environment variables used in .eslintrc.js for CRA dev server without restarting the dev server
/* 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.
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 April 18, 2019 21:19
highlights from my 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
<script src="https://browser.sentry-cdn.com/4.2.4/bundle.min.js" crossorigin="anonymous"
onerror="if(confirm('Connection lost\n\nReload?')) location.reload();"></script>
<script>
// String.includes polyfill from https://mths.be/includes v1.0.0 by @mathias
if (!String.prototype.includes) {
(function() {
'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
var toString = {}.toString;
var defineProperty = (function() {
// IE 8 only supports `Object.defineProperty` on DOM elements
@devinrhode2
devinrhode2 / cloudSettings
Last active December 19, 2019 00:36
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-12-19T00:36:16.895Z","extensionVersion":"v3.4.3"}
@devinrhode2
devinrhode2 / decorators.js
Created November 27, 2018 19:26 — forked from RSNara/decorators.js
An example of using decorators in ES5.
function memoize(object, name, descriptor) {
var fn = descriptor.value;
var memoized = function() {
memoized.cache = memoized.cache || {};
var key = JSON.stringify(arguments);
return memoized.cache[key] = memoized.cache[key]
? memoized.cache[key]
: fn.apply(this, arguments);
}
descriptor.value = memoized;
@devinrhode2
devinrhode2 / StrictjQuery3.js
Last active November 27, 2018 17:36
warn on empty jquery selection badSelectorAction devinrhode2
// simple working copy pasta version (requires extendFunction.js, devinrhode2/extendFunction.js
// https://github.com/devinrhode2/extendFunction.js
window.failsafe = 'failsafe';
// Don't like throwing errors? Define $.badSelectorAction to be whatever you want.
function badSelectorAction( selector, context, originalResult ) {
if (window.console && console.warn) {
console.warn( '$(\''+selector+'\') selected nothing. Do $(sel, "failsafe") to silence warning. Context:', context);
}
@devinrhode2
devinrhode2 / README.md
Last active November 18, 2018 23:32
git post/pre-push hook to upload changes over ftp

git pre-push/post-push ftp upload code

I'm looking to share what I've done and potentially get improvements on this code snippet from others - my pre-push hook for pushing to ftp:

$ code .git/hooks/pre-push

Works like a charm, but I'd love to not push unless I know there are no unmerged changes I should pull. I'm not sure how to do that. I know, if there are changes, a git hook should do exit 1 to abort the git push.

I searched around for a post-push hook but that proved to be a much more daunting task, because git does not have a post-push hook.

/** vim: et:ts=4:sw=4:sts=4
* @license RequireJS 2.3.6 Copyright jQuery Foundation and other contributors.
* Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
*/
//Not using strict: uneven strict support in browsers, #392, and causes
//problems with requirejs.exec()/transpiler plugins that may not be strict.
/*jslint regexp: true, nomen: true, sloppy: true */
/*global window, navigator, document, importScripts, setTimeout, opera */
(function(){