Skip to content

Instantly share code, notes, and snippets.

View herrbischoff's full-sized avatar

Marcel Bischoff herrbischoff

View GitHub Profile
@herrbischoff
herrbischoff / errors.php
Created April 9, 2015 20:35
Output all errors for development
error_reporting(E_ALL);
ini_set('display_errors', 1);
@herrbischoff
herrbischoff / multi.service
Created April 8, 2015 22:47
Advertising Linux Services via Avahi/Bonjour `/etc/avahi/services/multi.service`
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_smb._tcp</type>
@herrbischoff
herrbischoff / flush.sh
Created April 8, 2015 22:44
Flush DNS cache
dscacheutil -flushcache && sudo killall -HUP mDNSResponder
@herrbischoff
herrbischoff / ip.sh
Created April 8, 2015 22:42
Output Local IP Address in Linux
ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'
@herrbischoff
herrbischoff / email-address
Created April 8, 2015 22:40
E-Mail Address RegEx
^[\w\.\+\-=]+@[\w\.\-]+\.[\w\-]+$
@herrbischoff
herrbischoff / youtube-id
Created April 8, 2015 22:38
YouTube Video ID RegEx
youtu.*[\/|=]([0-9a-zA-Z]{11})[^0-9a-zA-Z]
@herrbischoff
herrbischoff / clearfix.css
Created April 8, 2015 22:34
CSS clearfix
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { zoom: 1; }
<!-- Running a Job Periodically -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.example.touchsomefile</string>
<key>ProgramArguments</key>
<array>
@herrbischoff
herrbischoff / create-icns.sh
Created April 8, 2015 22:32
Create icns Icon File from 1024px PNG Master
# An easy way to create .icns files
# Inspired by http://stackoverflow.com/a/20703594
function mkicns() {
if [[ -z "$@" ]]; then
echo "Input file missing"
else
filename=${1%.*}
mkdir $filename.iconset
sips -z 16 16 $1 --out $filename.iconset/icon_16x16.png
@herrbischoff
herrbischoff / optimize.sh
Created April 8, 2015 22:30
MySQL optimize
mysqlcheck --auto-repair --optimize --all-databases