Skip to content

Instantly share code, notes, and snippets.

View PhillippOhlandt's full-sized avatar

Phillipp Ohlandt PhillippOhlandt

  • Cisco Systems
  • Hamburg, Germany
  • 10:52 (UTC +02:00)
View GitHub Profile
@fideloper
fideloper / update_curl.sh
Last active January 11, 2024 15:23
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
<?php
// This line needs to be called after initialize but before run
$app['upload'] = $app->extend(
'upload',
function ($handler, $app) {
if ($app['request']->get('contenttypeslug') && $app['request']->get('id')) {
$handler->setPrefix("/".$app['request']->get('contenttypeslug')."/".$app['request']->get('id'));
}
var CKEDITORPluginExtras = false;
if (typeof(CKEDITOR) != 'undefined' ) {
CKEDITOR.on('instanceReady',function(event, instance){
if (CKEDITORPluginExtras) {
return;
}
var config = event.editor.config;
CKEDITOR.instances.body.destroy();
@fideloper
fideloper / install_mysql.sh
Last active April 30, 2016 07:26
Install MySQL 5.7 (dev, not general availability)
#!/usr/bin/env bash
ROOT_USER_PASS='root'
sudo apt-get update
sudo apt-get install -y vim curl tmux wget unzip zip htop
sudo apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5
sudo cat > /etc/apt/sources.list.d/mysql.list <<EOL
@greydnls
greydnls / specification.tpl
Created September 4, 2015 14:30
PHPSpec template php5
<?php
namespace %namespace%;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
class %name% extends ObjectBehavior
{
function it_is_initializable()
@JeffreyWay
JeffreyWay / .bash_profile
Created July 31, 2015 19:20
Prettier git logs
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
@zabirauf
zabirauf / expng.ex
Created July 23, 2015 08:32
PNG format Parser in Elixir
defmodule Expng do
defstruct [:width, :height, :bit_depth, :color_type, :compression, :filter, :interlace, :chunks]
def png_parse(<<
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A,
_length :: size(32),
"IHDR",
width :: size(32),
height :: size(32),
@adamwathan
adamwathan / v-cloak.md
Last active November 6, 2024 14:28
Useful CSS utilities for Vue.js cloaking

Handy helpers for controlling visibility of elements until Vue has compiled.

Use like:

<div v-cloak>
  <h1>
    <span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
    <span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
 
@urraka
urraka / -usage-.php
Last active July 5, 2021 13:40
Twig extension for correct indentation of the output.
<?php
require_once 'vendor/autoload.php'; // or however you load Twig
require_once 'Lexer.php';
require_once 'Indent.php';
$twig = new Twig_Environment(new Twig_Loader_Filesystem('templates'));
$twig->addExtension(new Indent_Twig_Extension());
$twig->setLexer(new Indent_Twig_Lexer($twig));
@amochohan
amochohan / 01_Laravel 5 Simple ACL manager_Readme.md
Last active March 21, 2025 14:47
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