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 / 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
@luceos
luceos / .ssh-config
Created August 29, 2013 11:25
ssh keep alive verhoging
TCPKeepAlive = yes
ServerAliveInterval = 30
ServerAliveCountMax = 12
@luceos
luceos / example.php
Last active December 20, 2015 03:19
HostingXS api example
<?PHP
require_once "<path>/<to>/hxsclient.php";
if( array_key_exists( "domaincheck" , $_POST )) {
$api = new hxsclient( <username> , "<password>" , "<sandbox=true/false>" );
$domainavailable = $api -> checkDomain( $_POST["domaincheck"] );
}
// enter the form