Skip to content

Instantly share code, notes, and snippets.

@cletusw
cletusw / backdrop.html
Created May 21, 2015 21:28
Generate a backdrop with a cutout (ie, for highlighting a page element in an app walkthrough)
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
<defs>
<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>
</mask>
</defs>
<rect width="100%" height="100%" x="0" y="0" fill="black" fill-opacity="0.75" mask="url(#walkthrough-backdrop-mask)"></rect>
</svg>
@cletusw
cletusw / downgrade.sh
Created April 15, 2015 05:49
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
cletusw / attribute-web-components.txt
Last active August 29, 2015 14:04
Attribute Web Components (Decorators?)
View live: http://bl.ocks.org/cletusw/64a0e8fda34eba1b8cd1
TODO: Make dynamic (adding or removing the attribute adds or removes the functionality)
<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">
<template>
<style>
:host {
position: absolute;