Skip to content

Instantly share code, notes, and snippets.

<?php
declare(strict_types=1);
use Rector\CodeQuality\Rector\BooleanAnd\SimplifyEmptyArrayCheckRector;
use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector;
use Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector;
use Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector;
use Rector\CodeQuality\Rector\FuncCall\SimplifyRegexPatternRector;
use Rector\CodeQuality\Rector\FuncCall\SimplifyStrposLowerRector;
@niepi
niepi / osx_php_homebrew.setup.md
Created February 28, 2012 13:23
OSX PHP Homebrew Setup

install php

with mysql pgsql intl support

$ brew install php --with-apache --with-mysql --with-pgsql --with-intl

set php timezone in php ini

date.timezone = Europe/Vienna
@niepi
niepi / ofx.php
Created October 17, 2010 08:21
php ofx parser
<?
// Session control
session_start();
if(!session_is_registered(login)) {
header("Location: ../login/login.htm");
exit;
}
else {
include ('../../lib/lib.php');
@niepi
niepi / .osx
Created July 30, 2012 20:15
.osx
# ~/.osx — http://mths.be/osx
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "MathBook Pro"
scutil --set HostName "MathBook Pro"
scutil --set LocalHostName "MathBook-Pro"
@niepi
niepi / Symfony2_Console_Cheat_Sheet.md
Created April 6, 2012 10:20
Symfony2 Console Cheat Sheet
@niepi
niepi / invoice.css
Last active January 2, 2016 11:58
Markdown Rechnung mit einen Stylesheet für Marked.app und einen Textexpander FillIn Snippet
/*
This document has been created with Marked.app <http://markedapp.com>, Copyright 2011 Brett Terpstra
Please leave this notice in place, along with any additional credits below.
---------------------------------------------------------------
Title: Invoice Niepi
Author: Thomas Niepraschk
Description: Basic invoice template.
*/
body {

How-to : Crashplan & Freenas

Pre-requisites

Install

Step 0: Skip if you are using existing install

@niepi
niepi / php-switch
Created August 27, 2013 17:17 — forked from torifat/php-switch
#!/bin/bash
# php switch for homebrew
# $ brew tap josegonzalez/php && brew install php53 --with-mysql && brew install php54 --with-mysql
# Might as well ask for password up-front, right?
sudo -v
VERSION_FILE="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/php-switch.version"
<?php
$apnsHost = 'gateway.sandbox.push.apple.com';
$apnsCert = 'apns-dev.pem';
$apnsPort = 2195;
$streamContext = stream_context_create();
stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert);
$apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext);
@niepi
niepi / gist:5576098
Last active December 17, 2015 07:49 — forked from chen206/gist:4030441
Install Postgres 9.2 on a clean Ubuntu 12.04
#!/bin/bash
#
# Install Postgres 9.2 on a clean Ubuntu 12.04
"""
LC_ALL issue
comment out the AcceptEnv LANG LC_* line in the remote /etc/ssh/sshd_config file.
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales
comment out the SendEnv LANG LC_* line in the local /etc/ssh/ssh_config file.