Skip to content

Instantly share code, notes, and snippets.

@jfroffice
jfroffice / git-delete-stale-branches.sh
Created April 17, 2020 09:38
git-delete-stale-branches
#!/usr/bin/env bash
while getopts "d" opt; do
case $opt in
d) dryRunOpt="--dry-run";;
esac
done
# prune local "cache" of remote branches first:
git fetch --prune origin
# delete merged to master branches:
@jfroffice
jfroffice / dabblet.css
Created May 31, 2015 07:48
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(0deg, #f06, yellow);
min-height: 100%;
<div>
<input type="text" [value]="newTodoTitle">
<button (click)="addTodo()">+</button>
<tab-container>
<tab-pane title="Good kids">
<div [ng-repeat|todo]="todosOf('good')">
<input type="checkbox"
[checked]="todo.done">
{{todo.title}}
<div ng-controller="SantaTodoController">
<input type="text" ng-model="newTodoTitle">
<button ng-click="addTodo()">+</button>
<tab-container>
<tab-pane title="Tobias">
<div ng-repeat="todo in todosOf('tobias')">
<input type="checkbox"
ng-model="todo.done">
{{todo.title}}
<button ng-click="deleteTodo(todo)">
@jfroffice
jfroffice / prettyprint.js
Created December 5, 2012 07:50
Pretty Print File Name - Skrinking the filename in the middle in order to keep extension
function prettyprint(data, max) {
var max = max || 50,
min = 4,
separator = '...',
before = max * 0.618,
nL = data.length,
after = max - before - separator.length;
if (after < min) {