Skip to content

Instantly share code, notes, and snippets.

View ariefadjie's full-sized avatar

Arief Adjie Wicaksono ariefadjie

View GitHub Profile
@Vinze
Vinze / calendar.php
Last active October 17, 2023 19:29
Create an HTML calendar with PHP and Carbon
<?php
// Make sure Carbon is available
function renderCalendar($dt) {
// Make sure to start at the beginnen of the month
$dt->startOfMonth();
// Set the headings (weeknumber + weekdays)
$headings = ['Weeknumber', 'Mondag', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saterday', 'Sunday'];
104.16.119.221 boards.4chan.org
104.16.59.249 i.4cdn.org
@nWidart
nWidart / validation.php
Last active May 31, 2020 13:42
A extensions validation rule for Laravel 5
<?php
// For example in AppServiceProvider
Validator::extend('extensions', function ($attribute, $value, $parameters) {
return in_array($value->getClientOriginalExtension(), $parameters);
});
Validator::replacer('extensions', function($message, $attribute, $rule, $parameters) {
return str_replace([':attribute', ':values'], [$attribute, implode(',', $parameters)], $message);
});
@amochohan
amochohan / 01_Laravel 5 Simple ACL manager_Readme.md
Last active April 22, 2024 17:19
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@spekkionu
spekkionu / composer.json
Created October 9, 2014 20:07
Standalone validation using laravel validation component
{
"name": "spakkionu/validate",
"description": "Validation Test",
"require": {
"illuminate/validation": "~4.2.9"
},
"license": "MIT",
"authors": [
{
"name": "Jonathan Bernardi",
@DominicImhof
DominicImhof / database.php
Created October 29, 2013 18:38
Connect Laravel 4 with Redis via UNIX domain sockets
<?php
return array(
'redis' => array(
'cluster' => true,
'default' => array(
'scheme' => 'unix',
'path' => '/tmp/redis.sock'
)
);
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"