Skip to content

Instantly share code, notes, and snippets.

View winks's full-sized avatar
🚮
Computers were a bad idea.

Florian Anderiasch winks

🚮
Computers were a bad idea.
View GitHub Profile
--- /home/useer/code/php-file-iterator/File/Iterator.php 2010-07-30 14:05:33.000000000 +0200
+++ ../File/Iterator.php 2010-07-30 14:45:08.000000000 +0200
@@ -138,12 +138,14 @@
*/
protected function acceptPath($path)
{
- if (is_dir($path)) {
+ if (is_dir(dirname($path))) {
foreach ($this->exclude as $exclude) {
if (strpos($path, $exclude) === 0) {
$ find|sort
.
./soap_testidentifier.php
./x
./x/vendor
./x/vendor/soap_testidentifier.php
$ phpcpd --verbose --exclude x/vendor .
phpcpd 1.3.1 by Sebastian Bergmann.
"nl" : {
today: 'Vandaag om %time',
tomorrow: 'Morgen om %time',
next: '%weekday om %time',
yesterday: 'Gisteren om %time',
last: 'Afgelopen %weekday om %time'
}
<?php
phpinfo();
<?php
phpinfo();
@winks
winks / strawman.rb
Created May 30, 2012 14:47
strawman - a simple puppet template checker
#!/usr/bin/env ruby
# strawman - a simple puppet template checker.
# use like:
# echo 'fqdn => test.example.org\n$webserver = ["host1", "host2"]' | strawman template.erb
# where fqdn is in facter format:
# key => value
# and $webserver is a global ruby var, like in your manifests
# seperated by newlines, delivered on STDIN
require 'erb'
<?php
use \Can\Server;
use \Can\Server\Router;
use \Can\Server\Route;
use \Can\Server\Request;
$router = new Router(
array(
new Route(
@winks
winks / gist:4055675
Created November 11, 2012 17:49 — forked from anonymous/gist:4055669
git2package
#!/bin/sh
#
# This is the shell script for building:
# 1. a TAR.GZ package;
# 2. a ZIP package
# of phpMyFAQ using what committed into Git.
#
# For creating a package simply run:
#
# ./git2package.sh
@winks
winks / bisect.sh
Created February 4, 2013 10:02
git bisect for Jenkins
#!/bin/bash
# git bisect job for jenkins, originally by @bashlog
GOOD_BUILD=$(curl 'http://jenkins.example.org:8080/job/BUILDNAME/lastStableBuild/api/json' | sed 's:[{},]:\n:g'|grep '"number":'|sed 's/.*://')
BAD_BUILD=$(($GOOD_BUILD + 1))
curl -f "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" || BAD_BUILD=$(($GOOD_BUILD + 2))
curl -f "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" || BAD_BUILD=$(($GOOD_BUILD + 3))
curl -f "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" || BAD_BUILD=$(($GOOD_BUILD + 4))
curl -f "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" || BAD_BUILD=$(($GOOD_BUILD + 5))
curl -f "http://jenkins.example.org:8080/job/BUILDNAME/$BAD_BUILD/api/json" || BAD_BUILD=$(($GOOD_BUILD + 6))
@winks
winks / collect.sh
Created February 15, 2013 21:44
Want to know which methods Topaz lacks? Fret not, use this handy script!
#!/bin/sh
if [[ "x${2}" = "x" ]]; then
echo "Usage: $0 /path/to/mri /path/to/topaz"
exit 1
fi
mri_dir=`readlink -f $1`
topaz_dir=`readlink -f $2`
echo "Using MRI dir : $mri_dir"