Skip to content

Instantly share code, notes, and snippets.

View luceos's full-sized avatar
👨‍🎨
Painting web

Daniël Klabbers luceos

👨‍🎨
Painting web
View GitHub Profile
@luceos
luceos / hostname validation
Created January 14, 2015 08:32
hostname validation
^([a-z0-9](-?[a-z0-9])*)+(\.[a-z0-9](-?[a-z0-9])*)*(\.[a-z0-9](-?[a-z0-9])+)+$
@luceos
luceos / ExtendedValidator.php
Created February 13, 2015 09:26
extending laravel 4 validation
<?php namespace Vendor\Package;
use Illuminate\Validation\Validator;
class ExtendedValidator extends Validator
{
// use validation rule "foo" to use
public function validateFoo($attribute, $value, $parameters)
{
return $value == "foo";
@luceos
luceos / AuthenticatedTrait.php
Created May 22, 2015 11:05
Route Authentication Middleware laravel 5
<?php
trait AuthenticatedTrait
{
/**
* The check to see whether access is allowed to some route
* @return bool
*/
public function allowedToAccessRoute()
{
@luceos
luceos / fixes.sh
Created June 10, 2015 13:02
linux rights fixes
find . -type d -print0 | xargs -0 chmod 0755
find . -type f -print0 | xargs -0 chmod 0644
@luceos
luceos / rollout.sh
Last active September 3, 2015 08:22
update script for laravel 4/5 creating a backup of files and database, while asking for approval along the way
#!/bin/bash
#
# Laravel update tool
#
#
# use: ./rollout.sh
#
# date: 2015-09-01
# by D. Klabbers / HostingXS B.V.
@luceos
luceos / update.sh
Created September 23, 2015 14:41
flarum updater
#!/usr/bin/env bash
base=${PWD}
release=${base}
# Install all Composer dependencies
cd ${release}/flarum
composer require flarum/core:dev-master@dev --prefer-dist --update-no-dev
composer update --prefer-dist --optimize-autoloader --ignore-platform-reqs --no-dev
@luceos
luceos / friends-of-flarum.md
Last active December 23, 2015 10:21
friends of flarum

:name

:name is a collaboration of Flarum extension developers, who want to share their experiences to help others at building Flarum extensions and improve the documentation from an outsider viewpoint.

Our checklist

In order to provide quality extensions and snippets, we follow this checklist as closely as possible;

  • Namespaces consist of the :name vendor and a unique package name prefixed by flarum: :name/flarum-package-name.
  • Packages are hosted on [Github][github] and registered on [Packagist][packagist], making it easily available through [Composer][composer].
@luceos
luceos / Flarum.xml
Created March 2, 2016 08:13
PHP Storm Style guide for Flarum
<code_scheme name="Flarum">
<option name="AUTODETECT_INDENTS" value="false" />
<option name="HTML_ATTRIBUTE_WRAP" value="0" />
<PHPCodeStyleSettings>
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" />
<option name="CONCAT_SPACES" value="false" />
<option name="PHPDOC_BLANK_LINE_BEFORE_TAGS" value="true" />
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
@luceos
luceos / gist:d1fdcd0e8a3419c567ad
Created March 24, 2016 11:48
flarum/core beat 5 changelog - 20160324
* a5c8ef0 Tweak user email confirmation alert
* cb428f1 Make StyleCI happy
* 3d11309 Merge pull request #862 from sijad/confirm-msg
|\
| * b13adfe Show alert for unverified User
|/
* b2b5789 info: Show commit hashes for Flarum core and extensions
* 673a78a info: Show loaded PHP extensions
* 31caced info: Show installation path
* 5d88ad2 info: Show base URL
nginx['custom_gitlab_server_config'] = "location ~ ^\/satis\/ {\n root /var/www/satis/public;\n index index.html index.php;\n rewrite ^\/satis(.*\.[json|html])$ $1 break;\n try_files $uri @satis;\n }\n location @satis {\n root /var/www/satis/public;\n fastcgi_pass unix:/var/run/php/php-fpm.sock;\n include /etc/gitlab/nginx/fastcgi_params;\n }\n"