Skip to content

Instantly share code, notes, and snippets.

View oluwajubelo1's full-sized avatar
🏠
Working from home

Oluwajubelo oluwajubelo1

🏠
Working from home
View GitHub Profile
@oluwajubelo1
oluwajubelo1 / docker-help.md
Created September 8, 2023 07:19 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

Kubernetes CheatSheet

This documentation lays out a step by step process of getting started on Kubernetes.

Install docker

To install docker we will switch to the root user just to make our work easier.

Ref: https://docs.docker.com/engine/install/ubuntu/

# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@oluwajubelo1
oluwajubelo1 / AppServiceProvider.php
Created October 8, 2019 07:53 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@oluwajubelo1
oluwajubelo1 / CanBeReplicated.php
Created August 27, 2019 19:51 — forked from mpociot/CanBeReplicated.php
Add the ability to replicate Laravel models to other models.
<?php
use Illuminate\Support\Arr;
trait CanBeReplicated
{
public function replicateTo(string $model, array $with = null, array $except = null)
{
$defaults = [
$this->getKeyName(),
@oluwajubelo1
oluwajubelo1 / BlogController.php
Created August 13, 2019 11:21 — forked from tobysteward/BlogController.php
Laravel AJAX Pagination with JQuery
<?php
class BlogController extends Controller
{
/**
* Posts
*
* @return void
*/
public function showPosts()
@oluwajubelo1
oluwajubelo1 / countries.php
Created August 2, 2019 22:04 — forked from JeffreyWay/countries.php
Country Names + Codes
[
"United States" => "us",
"Afghanistan" => "af",
"Albania" => "al",
"Algeria" => "dz",
"American Samoa" => "as",
"Andorra" => "ad",
"Angola" => "ad",
"Anguilla" => "ai",
"Antarctica" => "aq",
@oluwajubelo1
oluwajubelo1 / laravel.js
Created August 2, 2019 22:03 — forked from JeffreyWay/laravel.js
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {
@oluwajubelo1
oluwajubelo1 / Admin.php
Created June 23, 2019 14:37 — forked from ShunsukeKomuta/Admin.php
Multi Auth in Laravel 5.6
<?php
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class Admin extends Authenticatable
{
use Notifiable;