Skip to content

Instantly share code, notes, and snippets.

Darin Hensley dman777

Block or report user

Report or block dman777

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
@dman777
dman777 / findall_elements_deep.js
Created Apr 16, 2018 — forked from ebidel/findall_elements_deep.js
Finds all elements on the page, including those within shadow dom.
View findall_elements_deep.js
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*/
/**
* Finds all elements on the page, inclusive of those within shadow roots.
* @param {string=} selector Simple selector to filter the elements by. e.g. 'a', 'div.main'
* @return {!Array<string>} List of anchor hrefs.
*/
View gist:92092fc6813a89367e54ba7a7c2ac9eb
function broadcastSingleClient(eventType, result, httpObject) {
var newTime = new Date().valueOf();
broadcastTimeRemain = newTime - lastBroadcast.time;
broadcastTimeRemain = lastBroadcast.interval - broadcastTimeRemain;
broadcastTimeRemain = Math.round(broadcastTimeRemain/1000)+2;
result.broadcastStamp = broadcastTimeRemain;
result = JSON.stringify(result);
httpObject.write('data: { \"' + eventType + '\":\n');
httpObject.write('data:' + result + '\n');
httpObject.write('data: }' + '\n\n');
View gist:8190497beaf06880000e83901a9a1694
const runSingleCommand = () => {
require(path.join(__dirname, 'gulp/tasks', args[0]));
};
if (args.length === 1) {
runSingleCommand();
}
View gist:710f0196e63f698cc035edc536ece15b
alias develop="git checkout develop"
alias world='cd /cygdrive/c/git/gm-global-spredfast-gm-world-wall'
alias market='cd /cygdrive/c/git/gm.marketing.marketplace/MarketPlace.Web/Gm.Dm.Marketplace.WebUI'
cd /cygdrive/c/git/gm.marketing.marketplace/MarketPlace.Web/Gm.Dm.Marketplace.WebUI
alias parent='cd C:/git'
alias before-rebase='rm -vRf /cygdrive/c/git/gm.marketing.marketplace-before-rebase && cp -va /cygdrive/c/git/gm.marketing.marketplace /cygdrive/c/git/gm.marketing.marketplace-before-rebase'
View gist:0996c978d11eccf6e3ab174af8ce3db3
gulp = require('gulp');
gulp.task('setProduction', (cb) => {
process.env.CSS_DEST = 'dist/css';
process.env.JS_DEST = 'dist/js';
});
gulp.task('setDevelopment', (cb) => {
process.env.CSS_DEST = 'css/build';
process.env.JS_DEST = 'Scripts/build';
View gist:83e93e47d70ac909c6e95069cfbdf863
> foo = { a: 1 }
{ a: 1 }
> bar = JSON.stringify(foo)
'{"a":1}'
> foobar = JSON.parse(bar)
{ a: 1 }
> foobar.a =2
2
> foo.a
1
View gist:61f617061efa6702f11104151b7d58c6
file 1:
const selectAllBodyStyles = function selectAllBodyStyles(event) {
var vehicleType = event.target.dataset.vehicle;
var button =
document.querySelector(`[data-vehicle="${vehicleType}"]`);
var active = button.classList.contains('active');
var bodyStyles = document.querySelectorAll(`.${vehicleType}`);
View gist:23c4906cee3121f19a84f8587b31d716
function removeActiveClass(navItems) {
return navItems.forEach((navItem)=> {
navItem.classList.remove('active');
});
}
function addActiveClass(naveItems) {
navItems.some((navItem)=> {
var navSectionName = navSection.id.split('nav-section')[0];
View gist:32ed6b3940ef898874ad570cd657ecd4
.bundle((err, res) => {
if (err) return next(chalk.red(err));
const fileCopy = Object.assign({}, file);
fileCopy.contents = res;
return next(null, fileCopy);
});
-------------------------------------------------
View gist:3c067c0d8e58e55720f0a5b812b9710b
browserify(file.path)
.transform(babelify, {
presets: ['es2015'],
plugins: [ ['transform-strict-mode', { "strict": false }] ]
})
You can’t perform that action at this time.