Skip to content

Instantly share code, notes, and snippets.


Philippe Gerber bigwhoop

View GitHub Profile
bigwhoop / Failure
Created Feb 17, 2014
Vagrant: Failed to mount folders in Linux guest
View Failure
Bringing machine 'default' up with 'virtualbox' provider...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Running 'pre-boot' VM customizations...
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
bigwhoop / gist:6870288
Created Oct 7, 2013
Returns the current scale value used by bcmath. #php
View gist:6870288
* Returns the current scale value used by bcmath.
* @return int
function getbcscale() {
$scale = strlen(bcadd('0', '0')) - 2;
if ($scale === -1) {
$scale = 0;
bigwhoop / gist:4060588
Created Nov 12, 2012
deferred statements in php
View gist:4060588
'defer' puts statements on a LIFO stack and executes them right before the function returns.
function fooz() { function fooz() {
defer echo 'bai';
defer echo 'thx'; ... becomes ...
echo 'k'; echo 'k';
echo 'thx';
echo 'bai';
} }
View Lösung für PHPGangstas Aufgabe
function en(array $a)
$b = array($a[0]);
for ($i = 1, $l = count($a); $i < $l; $i++) {
$j = count($b) - 1;
$x = explode('-', $b[$j]);
if ((reset($x) >= end($x) && $a[$i] == end($x) - 1) || (reset($x) <= end($x) && $a[$i] == end($x) + 1)) {
View Greasemonkey script to auto-assign new Jira tickets to the current user
// ==UserScript==
// @name Jira "Assign to me"
// @namespace *
// @include */CreateIssue.jspa
// ==/UserScript==
var target = document.getElementById('assignee');
if (target.parentNode.hasChildNodes) {
for (var i = 0; i < target.parentNode.childNodes.length; i++) {
var child = target.parentNode.childNodes[i];
View gist:511521
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.49-community MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.