This code is usable only if you are on Home Assistant 0.114 or older
For Home Assistant 0.115 and newer please go to: https://github.com/AdamNaj/ZWaveGraphHA
| curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p' | |
| ### And that's all ! | |
| # I saw many fighting with finding first commit SHA or similar fancy thing. | |
| # Here we just rely on the GH API, asking commits at 1 per page and parsing the last page number in the header of the reply (whose body only holds the last commit !) | |
| # So this is robust and bandwidth efficient. :) | |
| # If one want the commit count of a specific SHA, just use : | |
| curl -I -k "https://api.github.com/repos/:owner/:repo/commits?per_page=1&sha=:sha" | sed -n '/^[Ll]ink:/ s/.*"next".*page=\([0-9]*\).*"last".*/\1/p' |
This code is usable only if you are on Home Assistant 0.114 or older
For Home Assistant 0.115 and newer please go to: https://github.com/AdamNaj/ZWaveGraphHA
| #!/bin/bash | |
| # | |
| # Copyright 2016 - Matteo Mattei <[email protected]> | |
| # This script is intended to be used to shrink raspberry pi images | |
| # created with dd client command. | |
| # Check if you are root | |
| if [ ! $(id -u) -eq 0 ]; then | |
| echo "ERROR: This program must run as root" | |
| exit 1 |
| #!/bin/bash --debugger | |
| set -e | |
| BRANCH="master" | |
| if grep -q BCM2708 /proc/cpuinfo; then | |
| echo "RPI BUILD!" | |
| RPI="1" | |
| fi | |
| [ -n "$1" ] && BRANCH=$1 |
| // Just before switching jobs: | |
| // Add one of these. | |
| // Preferably into the same commit where you do a large merge. | |
| // | |
| // This started as a tweet with a joke of "C++ pro-tip: #define private public", | |
| // and then it quickly escalated into more and more evil suggestions. | |
| // I've tried to capture interesting suggestions here. | |
| // | |
| // Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_, | |
| // @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant, |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |