Skip to content

Instantly share code, notes, and snippets.


Kingsley Raspe kingsloi

View GitHub Profile
kingsloi / pug-bomb.php
Created Dec 15, 2018 — forked from retgef/pug-bomb.php
Pug Bomb API Endpoint WordPress Plugin
View pug-bomb.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:
class Pugs_API_Endpoint{
kingsloi / PageController.php
Last active Nov 29, 2018 — forked from jeffochoa/EloquentSortableServiceProvider.php
Persistent Laravel filtering, pagination and column sorting link generation using macros
View PageController.php
// Http/Controllers/PageController.php
public function index() {
$users = Page::sort()->paginate(10)->appends(request()->query());
return view('pages', compact('pages'));
View rpi-gpio-epaper-full-picture.js
const fs = require('fs');
const PNG = require('pngjs').PNG;
const EPD = require('rpi-gpio-epaper');
function readImage(imagePath) {
return new Promise((resolve, reject) => {
.pipe(new PNG())
.on('parsed', function() {
curl -X GET \ \
-H 'cache-control: no-cache'
# Response:
# {"status":"online","lastReceived":1505584946,"expiryDate":1505585245}
curl -X POST \ \
-H 'authorization: Bearer <token>'
# Download
composer global require heyareyouonline/hayo
# Register
hayo register <token>
# Usage
hayo online # Go online
hayo offline # Go offline
hayo heartbeat # Send single heartbeat
View Laravel Spark Per Team User

Per Team User Subscription in Laravel Spark

If you want the ability to charge a team owner based on how many members their team has, like $10/user/month, then you utilize the Laravel Cashier functionality of incrementing the quantity.

You listen for when a new team member is added and you increase the quantity of the subscription by the amount of users and also listen for when a team member is removed to downsize charges. - Not Braintree Compatible

Within EventServiceProvider.php
'Laravel\Spark\Events\Teams\TeamMemberAdded' => [
kingsloi / [1] main.js
Created Feb 15, 2017 — forked from hfalucas/[1] main.js
[Vue.js] Authentication and Authorization
View [1] main.js
* Think of this "main.js" file as your application bootstrap.
import Vue from 'vue'
import Resource from 'vue-resource'
import VueRouter from 'vue-router'
import routes from './routes'
import middleware from './middleware'
kingsloi / AnyPage.vue
Created Jan 14, 2017
Vue 2 - VueRouter - Simple Dynamic breadcrumbs + Microdata
View AnyPage.vue
export default {
beforeRouteEnter(route, redirect, next) {
next(vm => {
vm.$http.get(`${API.BASE}/${API.PAGE}/${}`).then((response) => { =;
vm.eventHub.$emit('update-breadcrumb', [
title: 'Home',
kingsloi / PermissionServiceProvider.php
Created Jun 27, 2016
Spatie's Laravel Permission fix for registering Blade directives in Laravel 5.2
View PermissionServiceProvider.php
namespace Spatie\Permission;
use Blade;
use Illuminate\Support\ServiceProvider;
use Spatie\Permission\Contracts\Permission as PermissionContract;
use Spatie\Permission\Contracts\Role as RoleContract;
class PermissionServiceProvider extends ServiceProvider
kingsloi / .jshintrc
Created May 5, 2016
View .jshintrc
* =================
"globals": {
"localStorage": false,
"document": false,
"confirm" :false,