Skip to content

Instantly share code, notes, and snippets.

@vorporeal
vorporeal / prune_merged_branches.sh
Created April 15, 2022 18:44
Prune local branches that were merged into a remote GitHub repo using squash commits.
#!/bin/bash
# This script looks for local branches which have an upstream branch set, but
# where said upstream branch no longer exists. The implication here is that the
# engineer pushed the branch to GitHub (to send a PR for review), merged the PR,
# and (auto-)deleted the remote branch.
#
# The script asks for confirmation before deleting the local branches as this is
# destructive, and could cause someone to lose work if a branch gets into this
# state without its contents actually having been merged upstream.
<html>
<head>
<base href="//polygit.org/polymer+v1.1.3/components/">
<link href="polymer/polymer.html" rel="import">
<link href="paper-dialog/paper-dialog.html" rel="import">
<script>
function openDialog() {
document.getElementById('dialog').open();
}
</script>
@vorporeal
vorporeal / iron-fit-constrain-bug.html
Last active September 24, 2015 23:36
Simple page indicating a failure case of constrain() in PolymerFitBehavior
<html>
<head>
<base href="//polygit.org/polymer+v1.1.3/components/">
<link href="polymer/polymer.html" rel="import">
<link href="paper-dialog/paper-dialog.html" rel="import">
<script>
// There were JS errors being thrown due to incorrect usage of
// these methods, so I stubbed them out so the example would run.
Polymer.Gestures.add = function() {};
Polymer.Gestures.remove = function() {};
function browserVersionOf(unprefixedName, parentObject) {
// parentObject is optional and usually omitted, set it to window if it's not specified.
parentObject = parentObject || window;
var baseName = unprefixedName.charAt(0).toUpperCase() + unprefixedName.substring(1);
var i = 0, variants = [unprefixedName, 'webkit', 'moz', 'ms', 'o'];
var fullName = variants[0];
do {
if (typeof parentObject[fullName] == 'function') {
return parentObject[fullName];
}