Skip to content

Instantly share code, notes, and snippets.

@joegaffey
joegaffey / file_sort_month.sh
Last active January 1, 2018 14:01
Sort files into folders by month. Pass file name pattern in a parameter in quotes e.g. '*.jpg'.
#!/bin/bash
months='Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'
echo $months | xargs mkdir
for month in $months
do
ls -l $1 | grep $month | awk '{print $NF}' | xargs -I {} mv {} ./$month
done
@joegaffey
joegaffey / D3 sequence diagram
Last active July 13, 2023 00:42
D3.js sequence diagram
<!DOCTYPE html>
<meta name="robots" content="noindex">
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Sequence Diagram</title>
</head>
<body>
#%RAML 0.8
title: World Music API
baseUri: http://example.api.com/{version}
version: v1
schemas:
- halLink: |
{ "$schema": "http://json-schema.org/schema",
"type": "object",
"description": "a Hypertext Application Language link",