Skip to content

Instantly share code, notes, and snippets.

💭
profiting off the free labor of coders past... no wait company is not interested

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
@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
View console method extensions with sentry logging.html
<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 / decorators.js
Created Nov 27, 2018 — forked from RSNara/decorators.js
An example of using decorators in ES5.
View decorators.js
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 Nov 27, 2018
warn on empty jquery selection badSelectorAction devinrhode2
View StrictjQuery3.js
// 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 Nov 18, 2018
git post/pre-push hook to upload changes over ftp
View README.md

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.

View force-globals-require.js
/** 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(){
View performance musings.md

Would anyone be willing to share some performance numbers of an Ember build of the open source Ghost-Admin project in WSL and/or mac, in addition to how much RAM/CPU you have on each machine?

If you really want to go the extra mile and pair your numbers with some disk read/write : What are your disk read/write speeds measure as, and what your cpu speeds measure as, and consequently how fast ember server rebuilds the app.

I happen to be looking for a new machine myself, been meaning to visit a windows store and try convincing someone to let me setup ember with ghost and time the performance of it. I will try adding the windows defender exceptions mentioned above, and there's this other trick to increasing the write speed on windows (something about disabling write cache buffering, which makes it so you can potentially lose data in the lost of a sudden lose of power). Benchmarking the CPU with Geekbench and measuring the read/write speeds with one of these tools htt

@devinrhode2
devinrhode2 / binaryUtil.js
Created Jan 10, 2018 — forked from belohlavek/binaryUtil.js
ASCII to Binary and Binary to ASCII Utility functions in Javascript.
View binaryUtil.js
var Util = {
toBinary: function(input) {
var result = "";
for (var i = 0; i < input.length; i++) {
var bin = input[i].charCodeAt().toString(2);
result += Array(8 - bin.length + 1).join("0") + bin;
}
return result;
},
@devinrhode2
devinrhode2 / README.md
Last active Apr 2, 2019 — forked from tombigel/README.md
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)
View README.md

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run:

View Google Analytics.js Outbound Link Tracking.js
You can’t perform that action at this time.