This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download | |
composer global require heyareyouonline/hayo | |
# Register | |
hayo register <token> | |
# Usage | |
hayo online # Go online | |
hayo offline # Go offline | |
hayo heartbeat # Send single heartbeat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X GET \ | |
https://heyareyou.online/api/kingsley.raspe \ | |
-H 'cache-control: no-cache' | |
# Response: | |
# {"status":"online","lastReceived":1505584946,"expiryDate":1505585245} | |
curl -X POST \ | |
https://heyareyou.online/api/heartbeat \ | |
-H 'authorization: Bearer <token>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const PNG = require('pngjs').PNG; | |
const EPD = require('rpi-gpio-epaper'); | |
function readImage(imagePath) { | |
return new Promise((resolve, reject) => { | |
fs | |
.createReadStream(imagePath) | |
.pipe(new PNG()) | |
.on('parsed', function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Http/Controllers/PageController.php | |
public function index() { | |
$users = Page::sort()->paginate(10)->appends(request()->query()); | |
return view('pages', compact('pages')); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Pug Bomb API Endpoint | |
Description: Adds an API endpoint at /api/pugs/$n_pugs | |
Version: 0.1 | |
Author: Brian Fegter | |
Author URL: http://coderrr.com | |
*/ | |
class Pugs_API_Endpoint{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
############################################################ | |
# Usage # | |
# https://gist.github.com/hfossli/4368aa5a577742c3c9f9266ed214aa58 | |
############################################################ | |
function usage() { | |
if [ -n "$1" ]; then | |
echo -e "${RED}👉 $1${CLEAR}\n"; | |
fi |
OlderNewer