Skip to content

Instantly share code, notes, and snippets.

<?php
namespace Tests\Unit;
use Tests\AbstractTestCase;
class RomanTest extends AbstractTestCase
{
private function romanToNumeric($str)
{
@alexkb
alexkb / gist:8c8ad2f4acc336083ab111c1ed695be9
Created April 22, 2020 06:52
RemotePCView mac keyboard switch for Karabiner
{
"title": "RemotePCView",
"rules": [
{
"description": "Swap command and control",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_control",
<?php namespace App\Providers;
use Laravel\Lumen\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
protected $listen = [
\Illuminate\Queue\Events\Looping::class => [
\App\Listeners\Queue\ShouldQueueWorkerContinue::class,
],
@alexkb
alexkb / ShouldQueueWorkerContinue.php
Last active June 5, 2019 14:05
Example of a Laravel Looping Event Listener
<?php namespace App\Listeners\Queue;
use Illuminate\Support\Facades\Log;
use Illuminate\Queue\Events\Looping;
class ShouldQueueWorkerContinue
{
public function handle(Looping $eventLooping)
{
// Query a service or database here to determine
@alexkb
alexkb / nginx.conf
Created February 4, 2019 02:24 — forked from shortjared/nginx.conf
AWS API Gateway Nginx Reverse Proxy
# NOTE
#
#
# Use sed on the instance up to replace the INSTANCE_ID and DNS_RESOLVER with the following commands
#
####################################################################################################
# Fetch the private IP for resolving DNS dynamically in nginx
# We also need to escape the `.` from it for usage in later sed
#
# DNS_RESOLVER=`grep nameserver /etc/resolv.conf | cut -d " " -f2 | sed 's/\./\\./g'`
@alexkb
alexkb / notes-laravel-nova-customization.md
Last active July 18, 2019 13:11
Notes on laravel nova customization

The notes below assume you have an operational Laravel Nova installation.

Add'on's for Nova

novapackages.com

Logo

To remove the logo from the sidebar, take a look at resources/views/vendor/nova/partials/logo.blade.php. The contents of this template get automatically a-href'ed to your Nova Application path.

Starter guides

<style scoped>
.action-link {
cursor: pointer;
}
.m-b-none {
margin-bottom: 0;
}
</style>
<?php
use XeroPHP\Models\Accounting\Contact;
use XeroPHP\Models\Accounting\Organisation\Bill;
use XeroPHP\Models\Accounting\Organisation\Sale;
use XeroPHP\Models\Accounting\Organisation\PaymentTerm;
/**
* Class XeroContact
*
@alexkb
alexkb / isElectron.js
Created July 5, 2015 00:56
Snippet of js to check if an Electron client
function isElectron() {
return (window.navigator.userAgent.indexOf("Electron") !== -1);
}
Verifying that +alexkb is my openname (Bitcoin username). https://onename.io/alexkb