Skip to content

Instantly share code, notes, and snippets.

View kingsloi's full-sized avatar

Kingsley Raspe kingsloi

View GitHub Profile
@kingsloi
kingsloi / installation.sh
Last active December 5, 2017 23:56
HAYO
# Download
composer global require heyareyouonline/hayo
# Register
hayo register <token>
# Usage
hayo online # Go online
hayo offline # Go offline
hayo heartbeat # Send single heartbeat
@kingsloi
kingsloi / curl.sh
Last active September 28, 2017 21:14
HAYO
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>'
@kingsloi
kingsloi / rpi-gpio-epaper-full-picture.js
Created January 5, 2018 23:26 — forked from dbushell/rpi-gpio-epaper-full-picture.js
rpi-gpio-epaper full picture example
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() {
@kingsloi
kingsloi / PageController.php
Last active November 29, 2018 16:24 — forked from jeffochoa/EloquentSortableServiceProvider.php
Persistent Laravel filtering, pagination and column sorting link generation using macros
// Http/Controllers/PageController.php
public function index() {
$users = Page::sort()->paginate(10)->appends(request()->query());
return view('pages', compact('pages'));
}
@kingsloi
kingsloi / pug-bomb.php
Created December 15, 2018 00:00 — forked from retgef/pug-bomb.php
Pug Bomb API Endpoint WordPress Plugin
<?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{
@kingsloi
kingsloi / bootstrap.sh
Created February 6, 2024 19:34
New Server Bootstrapping Script
#!/bin/sh
############################################################
# Usage #
# https://gist.github.com/hfossli/4368aa5a577742c3c9f9266ed214aa58
############################################################
function usage() {
if [ -n "$1" ]; then
echo -e "${RED}👉 $1${CLEAR}\n";
fi