Skip to content

Instantly share code, notes, and snippets.

View Kokil's full-sized avatar
🙃

Kokil Kokil

🙃
View GitHub Profile
@goldsky
goldsky / login.redirect.usergroups.plugin.php
Created May 21, 2012 10:19
MODX's plugin to redirect specified usergroups after logged in using the Login snippet
<?php
if ($modx->event->name !== 'OnWebLogin')
return;
$usergroups = $user->getUserGroupNames();
if(empty($usergroups))
return;
switch (TRUE) {
@IngmarBoddington
IngmarBoddington / statusCodes
Last active June 15, 2024 10:57
HTTP Status Codes / Verbs List
CONNECT
DELETE
GET
HEAD
OPTIONS
PATCH
POST
PUT
TRACE
@thepsion5
thepsion5 / EloquentFooRepository.php
Created May 2, 2014 15:09
Example implementation of a Eloquent-based repository that provides a fluent interface for sorting and pagination without exposing the underlying model API.
<?php
class EloquenFooRepository
{
/**
* The base eloquent model
* @var Eloquent
*/
protected $model;
@jeffochoa
jeffochoa / Response.php
Last active May 22, 2024 04:06
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@khatriafaz
khatriafaz / laravel-permissions.sh
Last active April 10, 2021 18:51
Laravel server file permissions
#!/bin/bash
# Default variables
apachename="${1:-apache}"
username="${2:-$USER}"
folder="${3:-.}"
# Change ownership to webserver user/group
chown -R $apachename:$apachename $folder