Skip to content

Instantly share code, notes, and snippets.

View strebl's full-sized avatar

Manuel Strebel strebl

View GitHub Profile
@strebl
strebl / .php_cs
Last active November 8, 2018 03:30
onfig for PHP-CS-Fixer ver 2 (based on Style CI's Recommended Preset - https://styleci.readme.io/v1.0/docs/presets#section-recommended)
<?php
$rules = [
'binary_operator_spaces' => ['align_double_arrow' => true, 'align_equals' => false],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'blank_line_before_return' => true,
'braces' => true,
'cast_spaces' => true,
'class_definition' => true,
@strebl
strebl / taybalt.zsh-theme
Created January 16, 2017 15:00
Taylor Otwell's oh-my-zsh theme
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
@strebl
strebl / keybase.md
Created October 25, 2016 15:36
Keybase.io GitHub Verification

Keybase proof

I hereby claim:

  • I am strebl on github.
  • I am strebl (https://keybase.io/strebl) on keybase.
  • I have a public key whose fingerprint is 5C08 9C92 D84A 5B0A 3019 43F0 D1C2 E752 F619 E917

To claim this, I am signing this object:

@strebl
strebl / nginx.conf
Created December 9, 2015 11:05
caching & gzip
##
# Gzip Settings
##
# Enable Gzip compressed.
gzip on;
# Compression level (1-9).
# 5 is a perfect compromise between size and cpu usage, offering about
# 75% reduction for most ascii files (almost identical to level 9).
@strebl
strebl / README.md
Last active October 4, 2015 04:15
Simple Shell Backup to Drobox

Before first run

cd /home/strebel
curl "https://raw.githubusercontent.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh" -o dropbox_uploader.sh
chmod 775 dropbox_uploader.sh
./dropbox_uploader.sh
``

To configure dropbox_uploader.sh, you'll need to create a Dropbox API key.
@strebl
strebl / HowTo.md
Created October 3, 2015 20:48
PowerShell Episode Prefix

Add season prefix to episode name (E01.mkv => S01E01.mkv)

dir | Rename-Item -NewName { "S01" + $_.Name }
@strebl
strebl / HowTo.md
Last active September 21, 2015 14:39
Convert Laravel class strings to PHP 5.5 class constants using PhpStorm / Sublime Text / Regex

How-to

Replace the old class strings 'Illuminate\Foundation\Providers\ArtisanServiceProvider', with the new class constants Illuminate\Foundation\Providers\ArtisanServiceProvider::class, with following steps:

  1. Open an editor with a Regex search and replace function
  2. Search for '((?:Illuminate|App)\\.+)',
  3. Replace it with $1::class,

Be careful with that in files with namespaces. It most likely will break your code.

If you have namespace App\Console and a lot class strings like:

@strebl
strebl / URLs
Last active February 19, 2016 00:20
Server, Admin Panels, Web
http://redd.it/1xizt0 Gentoo?
strebl.ch/21ai Ajenti
strebl.ch/1u0w Vesta Control Panel
strebl.ch/to6 cPanel
strebl.ch/1usg Choosing control panel management
strebl.ch/qrr ServerPilot
strebl.ch/1dz6 ServerPilot Experience
strebl.ch/ntg PuPHPet - A simple GUI to set up virtual machines for Web development.
strebl.ch/1ucq Phansible provides an easy-to-use interface to generate Ansible provisionings.
$(function() {
var text = $("#code textarea").text();
var patt = new RegExp(/(.+?): ?(.+?);/gi);
var matches = [];
while (match = patt.exec(text)) {
console.log(match);
@strebl
strebl / 0_reuse_code.js
Created August 8, 2014 15:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console