Skip to content

Instantly share code, notes, and snippets.

@jaredjburgess
jaredjburgess / npm_run.txt
Last active May 21, 2016 15:26
The terminal command to access the defined scripts in the package.json. Will primarily use this to access devDependencies
npm run
@jaredjburgess
jaredjburgess / electron_app_menu_devtools.js
Created May 4, 2016 22:44
The item that needs to be added to the array that is passed to the Menu.buildFromTemplate electron function. This gives you dev tools in a menu in the tray.
{
label: 'View',
submenu: [
{
label: 'Toggle Developer Tools',
accelerator: (function() {
if (process.platform == 'darwin')
return 'Alt+Command+I';
else
return 'Ctrl+Shift+I';
@jaredjburgess
jaredjburgess / overflow_detection.js
Created April 22, 2016 14:06
A function to find which element is causing unintented body overflow.
var docWidth = document.documentElement.offsetWidth;
[].forEach.call(
document.querySelectorAll('*'),
function(el) {
if (el.offsetWidth > docWidth) {
console.log(el);
}
}
);
@jaredjburgess
jaredjburgess / git_remote_set_url_push.txt
Last active April 10, 2016 15:52
Push new url to bitbucket.
git remote set-url --push origin https://jared446432@bitbucket.org/stepsize/xxx.git
@jaredjburgess
jaredjburgess / git_remote_set_url.txt
Last active April 10, 2016 15:53
Set to new team name on bitbucket.
git remote set-url origin https://jared446432@bitbucket.org/stepsize/xxx.git
@jaredjburgess
jaredjburgess / git_pull.txt
Created March 30, 2016 16:43
Shortcut to pull.
git pull
@jaredjburgess
jaredjburgess / git_push.txt
Created March 30, 2016 16:42
Shortcut to push.
git push
@jaredjburgess
jaredjburgess / mutation_observer.js
Created March 30, 2016 14:09
Function for mutation observers with callbacks.
function createMutationObserver(target, config, callback) {
var observer = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
callback(mutation);
});
});
observer.observe(target, config);
}
@jaredjburgess
jaredjburgess / abbrv_check.txt
Created March 28, 2016 17:50
Checks if there is an abbreviation process running.
ps -ef | grep abbreviation
@jaredjburgess
jaredjburgess / script_tag_javascript.html
Created March 28, 2016 17:34
Shortcut to create a closed javascript script tag.
<script type="text/javascript"></script>