Skip to content

Instantly share code, notes, and snippets.

View stevebaros's full-sized avatar
🎧
Yes am available

Stephen Barungi stevebaros

🎧
Yes am available
View GitHub Profile
@stevebaros
stevebaros / mysql_cheat_sheet.md
Created September 8, 2022 17:13 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@stevebaros
stevebaros / README.md
Created March 18, 2022 06:11 — forked from ross-u/README.md
HTTP Methods & Status Codes - Cheatsheet

HTTP Methods & Status Codes - Cheatsheet



------
@stevebaros
stevebaros / models.go
Created November 10, 2021 18:11
Models( ClassLevel -> ClassList ->Subject -> PdfResource)
import "time"
type (
ClassLevel struct {
ID uint `gorm:"primaryKey"`
Number string `json:"number" gorm:"size:70;unique;not null"`
Name string `json:"name" form:"name" binding:"required" gorm:"size:60;unique;not null"`
LevelPic string `json:"level_pic" form:"level_pic" binding:"required" gorm:"not null"`
@stevebaros
stevebaros / random.go
Created September 16, 2021 16:10
Calculate area of a circle
// Go's `math/rand` package provides
// [pseudorandom number](http://en.wikipedia.org/wiki/Pseudorandom_number_generator)
// generation.
package main
import (
"fmt"
"math/rand"
"time"
@stevebaros
stevebaros / .php_cs.dist
Created September 30, 2020 18:23 — forked from Billz95/.php_cs.dist
A Customised fixer for PHP-CS-Fixer to use `prettier`'s php plugin to pre-process the code before getting analysed by other fixers. This would enable `php-cs-fixer` to take advantage of `prettier`'s ability of managing long line.
<?php
require_once __DIR__.'/relative/path/to/PrettierPHPFixer/File';
return PhpCsFixer\Config::create()
->registerCustomFixers([
(new PrettierPHPFixer()),
])
->setRules([
'Prettier/php' => true,
@stevebaros
stevebaros / axios-response-interceptor.js
Created August 30, 2020 07:45 — forked from FilipBartos/axios-response-interceptor.js
Axios response interceptor for access token refresh supporting 1 to N async requests
let isAlreadyFetchingAccessToken = false
let subscribers = []
function onAccessTokenFetched(access_token) {
subscribers = subscribers.filter(callback => callback(access_token))
}
function addSubscriber(callback) {
subscribers.push(callback)
}
@stevebaros
stevebaros / php_java_developer_books_to_read
Created March 2, 2020 12:46
Want to become a PHP and Java pro ? then read these books
Modern PHP (by Josh Lockhart)
Scaling PHP Apps (by Steve Corona)
Modular Programming with PHP 7 (by Branko Ajzele)
PHP the right way (by Josh Lockhart and the PHP community)
Mastering PHP Design Patterns (by Junade Ali)
Design Patterns (by GoF)
Head First Design Patterns (by Elisabeth Freeman and Kathy Sierra)
Software Architecture Patterns (by Mark Richards)
Patterns of Enterprise Application Architecture (by Martin Fowler)
The Clean Coder (by Robert Martin)
@stevebaros
stevebaros / digdag.md
Last active May 11, 2020 13:51 — forked from hiroyuki-sato/digdag.md
digdag embulk example - Move Large volumes of data using Embulk from any data store to another.

hoge.dig

timezone: UTC

_export:
  my_path: "/tmp/hoge/csv"

+step1:
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddSubReferenceToFormSubmissionsTable extends Migration
{
/**
* Run the migrations.
@stevebaros
stevebaros / RestControllerTrait.php
Created December 5, 2019 11:59 — forked from Idnan/ RestControllerTrait.php
Laravel Lumen: RESTful trait
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
trait RestControllerTrait {
public function index() {
$model = self::MODEL;