Skip to content

Instantly share code, notes, and snippets.

View schnipseljagd's full-sized avatar

Joscha Meyer schnipseljagd

  • superluminar GmbH
  • Granada
View GitHub Profile

Keybase proof

I hereby claim:

  • I am schnipseljagd on github.
  • I am oschenposchen (https://keybase.io/oschenposchen) on keybase.
  • I have a public key ASD7ok4HgAKJVwEozDFxqwSMYcspG3H_xRrBOMlG1mqtDQo

To claim this, I am signing this object:

[core]
editor = vim
[user]
email = <mail>
name = <name>
[github]
user = <user>
token = <token>
[alias]
co = checkout
<?php
function isAssoc($arr)
{
return array_keys($arr) !== range(0, count($arr) - 1);
}
function is_assoc($array) {
return (bool)count(array_filter(array_keys($array), 'is_string'));
}
@schnipseljagd
schnipseljagd / php-fizzbuzz
Created October 26, 2012 10:26
fizzbuzz in php
function fizzbuzz($number, $output) {
// try with 100 ;-)
if ($number > 97) {
return $output;
}
if ($number % 3 == 0 && $number % 5 == 0) {
$output .= "fizzbuzz\n";
} else if ($number % 3 == 0) {
$output .= "fizz\n";
} else if ($number % 5 == 0) {
@schnipseljagd
schnipseljagd / prepare-commit-msg
Created November 9, 2011 15:40
prepare commit message wih refs generation
#!/bin/bash
#
# prepends the current branch to the commit subject
# replace it if a commit got e. g. cherry-picked
#
BRANCH=$(git name-rev --name-only HEAD)
# strip possible old branch (if cherry-picked)
COMMIT_MSG=$(sed -r -e 's/\([a-z0-9-]+\) //ig' $1)
#add reference dummy if in branch dev and not in commit message