Skip to content

Instantly share code, notes, and snippets.

View fwartner's full-sized avatar
😻
Doing cool stuff

Florian Wartner fwartner

😻
Doing cool stuff
View GitHub Profile
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
if (!function_exists('include_css')) {
function include_css($uri = assets_url($data)) {
return "<link rel='stylesheet' type='text/css' href='" . $uri . "'>";
}
}
@fwartner
fwartner / gravatar_helper.php
Created June 24, 2014 16:24
Gravatar Image-Helper for CodeIgniter
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
if (!function_exists('get_gravatar')) {
function get_gravatar( $email, $s, $d = 'mm', $r = 'g', $img = false, $atts = array() ) {
$url = 'http://www.gravatar.com/avatar/';
$url .= md5( strtolower( trim( $email ) ) );
$url .= "?s=$s&d=$d&r=$r";
if ( $img ) {
$url = '<img src="' . $url . '"';
foreach ( $atts as $key => $val )
#!/bin/bash
apt-get update
apt-get -y dist-upgrade
# Install dokku
# Has to be ran twice for success, not sure why
wget -qO- https://raw.github.com/progrium/dokku/v0.2.3/bootstrap.sh | sudo DOKKU_TAG=v0.2.3 bash
wget -qO- https://raw.github.com/progrium/dokku/v0.2.3/bootstrap.sh | sudo DOKKU_TAG=v0.2.3 bash
#!/bin/bash
cd ..
env -i git checkout -f
if [ -f composer.json ]; then
composer install
fi
@fwartner
fwartner / #DaftPunKonsole.markdown
Created February 18, 2015 14:36
#DaftPunKonsole

#DaftPunKonsole

A console to recreate the famous "Harder, Better, Faster, Stronger" by Daft Punk. Use your keyboard ! not the mouse (hey, it's a console). Use the other keys to get different sounds (Normal, High, Low). You can do it !

Forked from Malik Dellidj's Pen #DaftPunKonsole.

A Pen by Florian Wartner on CodePen.

#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install autofs -y
sudo mkdir /automnt
sudo echo "/automnt /etc/auto.automnt --timeout=5 --ghost" > /etc/auto.automnt
sudo blkid -o list -w /dev/null
<?php
/**
* This exemple shows how to parse base64 encoded images (submitted using Summernote), save them locally
* and replace the 'src' attribute in the submited HTML content
*
**/
use Intervention\Image\ImageManagerStatic as Image;
class PostController {
public function edit(){
@fwartner
fwartner / widget-bootstrap.html
Created October 29, 2015 13:20 — forked from alfg/widget-bootstrap.html
Bootstrap files for creating embedded widgets for your site
<html>
<head>
<title>Sample Widget Page</title>
</head>
<body>
<h1>Sample Widget Page</h1>
<script type="text/javascript" src="http://localhost:81/widget-bootstrap.js"></script>
<div id="widget-container"></div>

##Rotating Pricing Table for Laravel Spark

Can be placed anywhere, try it out on welcome.blade.php


Laravel Spark Pricing Table ###If you're using team plans just swap out $sparkPlans = Spark::plans(); with $sparkPlans = Spark::teamPlans();


@fwartner
fwartner / Envoy.blade.php
Created March 3, 2017 11:40
Envoy Automation Template
@servers(['production' => 'forge@YOUR-SERVER', 'localhost' => '127.0.0.1'])
@story('production')
compile
deploy
@endstory
@task('compile', ['on' => 'localhost'])
cd ~/Development/Sites/YOUR-SITE
npm run production