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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / install_nginx_w_spdy.sh
Last active August 29, 2015 13:55
Install nginx and compile with speedy from commandline, use parameter to select version, image_filter requires php5-gd/php_gd and libgd2-xpm-dev
#!/bin/sh
#
# Obsolete; nginx 1.5.10 has in-built option for spdy, with compilation option: --with-http_spdy_module
#
# use ./install_nginx_w_spdy.sh <version>
NGINX_VERSION=$1
TMP_PATH=/tmp
@luceos
luceos / Laravel sources.md
Last active January 1, 2016 04:59
Laravel Sources of documentation