Skip to content

Instantly share code, notes, and snippets.

@sabas1080
sabas1080 / ESP32_HID.ino
Last active November 25, 2024 08:30
Example of HID Keyboard BLE with ESP32
/*
Copyright (c) 2014-2020 Electronic Cats SAPI de CV. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@joegaffey
joegaffey / file_sort_month_num.sh
Last active January 1, 2018 14:03
Sort files into folders by month number. 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)
monthNums='01 02 03 04 05 06 07 08 09 10 11 12'
echo $monthNums | xargs mkdir
i=0
for monthNum in $monthNums
do
ls -l $1 | grep ${months[$i]} | awk '{print $NF}' | xargs -I {} mv {} ./$monthNum
@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",