Skip to content

Instantly share code, notes, and snippets.

Fabian Mu fabianmu

Block or report user

Report or block fabianmu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bootstrap.php
// this is in the `/config` folder
$app->on("", function($name, &$entry, $isUpdate) use ($app) {
// generate slug on create only or when an existing one is empty
if (!$isUpdate || ($isUpdate && trim($entry['slug']) == '')) {
// generate slug based on entry name
$slug = Str::slug($entry['name']);
View gist:3467a28e274f03fd9dfe20b2a6f7feca
# this is a copay/paste combination of &
# so that we can install virtualbox via apt-get
for x in xenial xenial-security xenial-updates; do
egrep -qe "deb-src.* $x " /etc/apt/sources.list || echo "deb-src ${x} main universe" | sudo tee -a /etc/apt/sources.list
echo "deb xenial contrib" | sudo tee -a /etc/apt/sources.list.d/virtualbox.list
wget -q -O- | sudo apt-key add -
# allow us to make a kernel
fabianmu / Dockerfile
Last active Jun 19, 2017
host an adonis js app on a laravel forge server via docker compose
View Dockerfile
FROM node:7
RUN useradd --user-group --create-home --shell /bin/false app
ENV HOME=/home/app
COPY package.json $HOME/
RUN chown -R app:app $HOME/*
USER root

Keybase proof

I hereby claim:

  • I am fabianmu on github.
  • I am fabianmu ( on keybase.
  • I have a public key whose fingerprint is 2B41 3AE6 3AFF 0E86 69B5 7FC9 9FB4 EF5A E9D7 1ABD

To claim this, I am signing this object:

fabianmu / RoleAndPermissionSeeder.php
Created Nov 27, 2015
laravel role based permission acl sample
View RoleAndPermissionSeeder.php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\App;
use App\Role;
use App\Permission;
use App\User;
class RoleAndPermissionSeeder extends Seeder
fabianmu / html.html
Last active Aug 29, 2015
toggle button
View html.html
<div class="toggle-button respond-toggle" data-service="respond">
<span class="toggle-button-switch"></span>
<span class="toggle-button-label" data-off="no" data-on="yes"></span>
<%= hidden_field_tag "respond", "false", :'data-service' => "respond" %>
View Envoy.blade.php
{{-- Define all our servers --}}
@servers(['staging' => '', 'production' => ''])
{{-- The timezone your servers run in --}}
$timezone = 'Europe/Amsterdam';
{{-- The base path where your deployments are sitting --}}
$path = '/var/www/';
View gist:5505444
#!/usr/bin/env bash
# call like this on the target server:
# NODENAME='foo' CHEF_ENV='production' RUNLIST='["role[foo]","recipe[bar]"]' CHEFREPO='' bash <( curl -L )
# You will need to ensure that the ssh key is already set up on the server.
set -e
export WWW_DIR="/var/www"
export CHEF_DIR="/var/www/html"
sudo rm -rf $CHEF_DIR
You can’t perform that action at this time.