Skip to content

Instantly share code, notes, and snippets.

Clayton Watts cletusw

Block or report user

Report or block cletusw

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
View designer.html
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-scroll-header-panel/core-scroll-header-panel.html">
<polymer-element name="my-element">
:host {
position: absolute;
cletusw / attribute-web-components.txt
Last active Aug 29, 2015
Attribute Web Components (Decorators?)
View attribute-web-components.txt
View live:
TODO: Make dynamic (adding or removing the attribute adds or removes the functionality)
cletusw /
Created Apr 15, 2015
Convert video to x264 in mp4
ffmpeg -i "$1" -c:v libx264 -preset veryslow -crf 35 -c:a copy "${1:0: -4} low.mp4"
cletusw / backdrop.html
Created May 21, 2015
Generate a backdrop with a cutout (ie, for highlighting a page element in an app walkthrough)
View backdrop.html
<svg xmlns="" width="100%" height="100%">
<mask id="walkthrough-backdrop-mask">
<rect width="100%" height="100%" x="0" y="0" fill="white"></rect>
<ellipse class="hole" ng-attr-cx="{{cutoutCenterX}}" ng-attr-cy="{{cutoutCenterY}}" ng-attr-rx="{{cutoutRadiusX}}" ng-attr-ry="{{cutoutRadiusY}}" fill="black"></ellipse>
<rect width="100%" height="100%" x="0" y="0" fill="black" fill-opacity="0.75" mask="url(#walkthrough-backdrop-mask)"></rect>
cletusw / polymer-element.sublime-snippet
Last active Dec 21, 2015
Here's a Sublime Text snippet for quickly creating polymer-elements. Just type "<polymer" and press TAB to generate the empty element, then tab through the different fields to add a name (which is automatically mirrored to the Polymer() call), attribute default values in the prototype (which are automatically mirrored to the "attributes" attribu…
View polymer-element.sublime-snippet
<link rel="import" href="../../bower_components/polymer/polymer.html">
<polymer-element name="$1" attributes="${2/:[^\n$]*(\n[ \t]*|$)/ /g}">
:host {
display: block;
git blame --line-porcelain -L 300,319 path/to/file.js | sed -n 's/^author //p' | sort | uniq -c | sort -rn | sed -n '1 p' | sed -n 's/^ *[0-9]* //p'
# Or to see all for an entire directory
git log --pretty=format:"%an" -- path/to/dir/ | sort | uniq -c | sort -rn
View test
cletusw / html-webpack-header-loader.js
Last active Jul 14, 2017
Add javascript to be added to the webpack-built JS file directly in your HTML (for declaring dependencies, etc.)
View html-webpack-header-loader.js
// template.html
<script type="text/javascript-webpack-header">
console.log('loaded template');
<h1>This is the template</h1>
View My Git config
apply.whitespace fix
core.whitespace 'space-before-tab,-indent-with-non-tab,trailing-space'
core.ignorecase true
diff.renames copies
merge.ff only
merge.conflictstyle diff3
pull.ff only
push.default upstream
push.followTags true
rerere.enabled 1
cletusw / almost-amd-to-commonjs.js
Last active Aug 16, 2017
Codemod: AMD in CommonJS style -> CommonJS
View almost-amd-to-commonjs.js
* Run this with jscodeshift
* Live demo:
* Converts:
* define(function (require) {
* var React = require('react');
* const props = { foo: 'bar' };
* return React.createClass(props);
* });
You can’t perform that action at this time.