Skip to content

Instantly share code, notes, and snippets.

View JohnRoux's full-sized avatar

John Roux JohnRoux

  • RouxtAccess
  • Cape Town, South Africa
View GitHub Profile
@JohnRoux
JohnRoux / TestArraySpeed.php
Created June 11, 2024 17:16
app:test-array-speed
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Benchmark;
class TestArraySpeed extends Command
{
@JohnRoux
JohnRoux / ZATech Freelancer Resources.md
Last active March 7, 2022 17:32
ZATech Freelancer Resources

Before you start freelancing:

John Roux

Are you a senior?

nuclearpengy

Before freelancing ask yourself:

Do you love doing admin? - rock solid admin can be the difference between a happy life and endless battles with SARS. Do you get work done whether or not anyone is asking you and do you currently manage your time well. Could you meet deadlines and get work done and still "have a life"? - When you're freelancing, no one is going to encourage you, motivate you, push you to be the best you can be, you need to want this for yourself.

@JohnRoux
JohnRoux / api-docs.json
Created September 16, 2020 08:39
Example Swagger doc using allOf for Object contents
{
"openapi": "3.0.0",
"info": {
"title": "Demo App",
"contact": {
"email": "support@demo.app"
},
"version": "1.0.0"
},
"paths": {
@JohnRoux
JohnRoux / varsity.sql
Created June 8, 2020 14:18
Dependant Courses example sql db
CREATE SCHEMA IF NOT EXISTS `varsity`;
CREATE TABLE `varsity`.`courses` (
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NULL,
PRIMARY KEY (`id`));
CREATE TABLE `varsity`.`prerequisites` (
`parent_course_id` BIGINT UNSIGNED NOT NULL,
`child_course_id` BIGINT UNSIGNED NOT NULL,
@JohnRoux
JohnRoux / PHP Reference Passing Demo
Last active November 11, 2016 08:52
Demo of how using references in PHP loops can be extremely beneficial, but beware of potential issues!
Welcome to the Demo
This is going to look at the differences of iterating through loops, passing via reference and passing via value in PHP. Basically this is all a matter of PHP scope, at what point do objects exist and are you actually editing what you think you are?
Original Array
/var/www/dev.runwaysale.local/runwaysale/refdemo.php:20:
array (size=4)
'Name' => string 'Fred' (length=4)
'Description' => string 'Man' (length=3)