Skip to content

Instantly share code, notes, and snippets.

View dman777's full-sized avatar

Darin Hensley dman777

View GitHub Profile
one@localhost ~/material-web
% npm run storybook
> @material/web@1.0.0-pre.13 storybook
> storybook dev -p 6006
@storybook/cli v7.0.27
info => Starting manager..
info Addon-docs: using MDX2
#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);
" 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 = ""
@dman777
dman777 / markdown.md
Created August 24, 2020 20:51 — forked from ShawnClake/markdown.md
Markdown Cheat sheet
@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 / 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.
*/
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,
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)
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
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