Skip to content

Instantly share code, notes, and snippets.

View dman777's full-sized avatar

Darin Hensley dman777

View GitHub Profile
@dman777
dman777 / gist:f23fa03cf1be2534787a
Created February 1, 2016 01:18
ssh greeting motd
root@old-dash:/etc# cat -e motd
^[[2J$
^[[34m$
. $
.vir. d$b$
.d$$$$$$b. .cd$$b. .d$$b. d$$$$$$$$$$$b .d$$b. .d$$b.$
$$$$( )$$$b d$$$()$$$. d$$$$$$$b Q$$$$$$$P$$$P.$$$$$$$b. .$$$$$$$b.$
Q$$$$$$$$$$B$$$$$$$$P" d$$$PQ$$$$b. $$$$. .$$$P' `$$$ .$$$P' `$$$$
"$$$$$$$P Q$$$$$$$b d$$$P Q$$$$b $$$$b $$$$b..d$$$ $$$$b..d$$$$
d$$$$$$P" "$$$$$$$$ Q$$$ Q$$$$ $$$$$ `Q$$$$$$$P `Q$$$$$$$P$
localhost kvm # cat /mnt/temp/home/one/.ssh/config
Host 162.242.145.217
ForwardAgent yes
User one
ProxyCommand ssh -q -A -W %h:%p cbast1.dfw1.corp.foo.com
Host cbast1.*.corp.foo.com
ControlPersist yes
ControlMaster auto
ControlPath /tmp/ssh-%r@%h:%p
files=./images/*
while read -r file;
do
grep -l "$file" -R * | grep -v MarketPlaceLog | grep -v cache > /dev/null
if [ $? -eq 0 ]
then
echo $file
fi
while read -r file;
do
grep -l "$file" -R * | grep -v MarketPlaceLog | grep -v cache > /dev/null
if [ $? -eq 0 ]
then
echo $file
fi
done < <(ls ./images)
const buildScriptFile = (appName, gulp, plugins, buildFiles)
=> gulp.src(buildFiles)
.pipe(plugins.sourcemaps.init())
.pipe(babel({
presets: ['env']
})
.pipe(plugins.concat(`${appName}.min.js`))
//.pipe(plugins.uglify())
.pipe(plugins.size({
showFiles: true,
@dman777
dman777 / findall_elements_deep.js
Created April 16, 2018 22:03 — forked from ebidel/findall_elements_deep.js
Finds all elements on the page, including those within shadow dom.
/**
* @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.
*/
@dman777
dman777 / gist:138db668efbc1d929118c53dc8b236fc
Last active January 21, 2021 23:13
architecture for web components

Last updated: 01/21/2021

Best practices for web components

These tips came from Google's Polymer team, the originator and creator of web components. These patterns and architecture can be applied to any re-usable component regardless if it's a true webcomponent or not.

Videos:

Data Flow in Polymer Elements - mediator pattern

@dman777
dman777 / markdown.md
Created August 24, 2020 20:51 — forked from ShawnClake/markdown.md
Markdown Cheat sheet
" EXAMPLE SETUP
"
" Show the syntax group name of the item under cursor.
" map -a :call SyntaxAttr()<CR>
function! SyntaxAttr()
let synid = ""
let guifg = ""
let guibg = ""
let gui = ""
#downloadJSPdf() {
const loadJspdf = (() => {
async function actuallyLoad() {
const script = document.createElement('script');
script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js';
await new Promise((resolve, reject) => {
script.addEventListener('error', reject);
script.addEventListener('load', resolve);
document.head.appendChild(script);