Skip to content

Instantly share code, notes, and snippets.

View Sentences's full-sized avatar
👔
Dealing with Laravel

Nico R Sentences

👔
Dealing with Laravel
View GitHub Profile
@Sentences
Sentences / dbbackup.sh
Created March 8, 2017 13:04
Database Backup Shell-Script
#!/bin/bash
# Nico Renken
# 2017
# Datenbanken
declare -a hosts=("127.0.0.2" "127.0.0.3" )
declare -a dbs=("db_12345" "db_54321" )
declare -a users=("u_12345" "u_54321" )
declare -a pass=("secure" "moresecure" )
# Verzeichnis zum Sichern
Backupdir="/home/users/alfed/dbBackups"
script:
ini_set('opcache.enable', 0);
.htaccess:
php_flag opcache.enable Off
php.ini:
opcache.enable=0
@Sentences
Sentences / response.php
Created October 24, 2012 10:38
Laravel Response extend for inline displaying of images
<?php
use Laravel\File;
/**
* Put this in laravels libraries dir and make sure to
* remove Response in /config/application.php
* This file will be autoloaded by default.
*
* @author Nico R <lt500r@gmail.com>
*/
class Response extends \Laravel\Response
@Sentences
Sentences / .htaccess
Created October 24, 2012 08:22
Enable mod_deflate in htaccess
# Compress the output if possible
<IfModule mod_deflate.c>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ \ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.(?:exe|t?gz|zip|bz2|sit|rar)$ \ no-gzip dont-vary
SetEnvIfNoCase Request_URI \.pdf$ no-gzip dont-vary
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</IfModule>
@Sentences
Sentences / libraries-file.php
Created October 23, 2012 14:14 — forked from sparksp/libraries-file.php
Extended File for Laravel
<?php
/**
* File
*
* Note: Remember to remove the "File" alias in APP_DIR/config/application.php
*
* @author Phill Sparks <me@phills.me.uk>
*/
class File extends Laravel\File {