Skip to content

Instantly share code, notes, and snippets.

View cyrildewit's full-sized avatar
💻

Cyril de Wit cyrildewit

💻
View GitHub Profile
@sydgren
sydgren / app\Http\Controllers\Api\Controller.php
Created April 24, 2018 11:42
Laravel API versioning using the Accept-Version header
<?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller as BaseController;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
abstract class Controller extends BaseController
{
protected $realClass;
@NBZ4live
NBZ4live / LumenAdapter.php
Created March 6, 2018 14:30
PHP-PM Lumen adapter
<?php
namespace App\PHPPM;
use Illuminate\Container\BoundMethod;
use Illuminate\Support\ServiceProvider;
use PHPPM\Bootstraps\Laravel;
class LumenAdapter extends Laravel
{
@avataru
avataru / EloquentCheatSheet.md
Last active May 17, 2025 04:35
Eloquent relationships cheat sheet
@MWins
MWins / project-ideas01.md
Last active April 27, 2025 02:28
Back end Projects - list

Project Ideas

Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.

I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.

If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.

Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.

@pvledoux
pvledoux / ApiVersion.php
Created September 12, 2017 09:18
Laravel 5.5 API versioning based header. It's not working because the route has already been binded, but I kept it here for the record
<?php namespace App;
/**
* ApiVersion class
*
* @author pvl
*/
class ApiVersion
{
private static $valid_api_versions = [
@actionm
actionm / deploy.sh
Created February 28, 2017 19:01
Zero downtime deployment script
# Deployment with zero downtime
# By default keeps 2 last deployments in KEEP_DEPLOYMENTS_DIR and current deployment
# Project domain
PROJECT_NAME=test.com
# Project directory
PROJECT_DIR=/home/forge/test.com
# Deployments directory
KEEP_DEPLOYMENTS_DIR=/home/forge/deploy
@BretFisher
BretFisher / docker-for-mac.md
Last active May 15, 2025 16:59
Getting a Shell in the Docker Desktop Mac VM

2021 Update: Easiest option is Justin's repo and image

Just run this from your Mac terminal and it'll drop you in a container with full permissions on the Docker VM. This also works for Docker for Windows for getting in Moby Linux VM (doesn't work for Windows Containers).

docker run -it --rm --privileged --pid=host justincormack/nsenter1

more info: https://github.com/justincormack/nsenter1


@jacurtis
jacurtis / _spacing-helpers.scss
Last active April 21, 2025 02:28
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@orta
orta / Issue.md
Last active April 29, 2023 08:19
Disclosable Sections in a GH issue
Summary text. Hello World, how is it going?
@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active March 21, 2025 14:46
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip