Skip to content

Instantly share code, notes, and snippets.

View beberlei's full-sized avatar
💯

Benjamin Eberlei beberlei

💯
View GitHub Profile
@beberlei
beberlei / .block
Last active August 28, 2018 15:02 — forked from mbostock/.block
Bar Chart
license: gpl-3.0
$products = array();
foreach($arr['accounts'] as $val) {
$account_id = $val['account_id'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://api.appannie.com/v1.2/accounts/'.$account_id.'/sales?break_down=product&start_date=2015-01-01&end_date=2015-01-31');
@beberlei
beberlei / README.md
Last active December 21, 2015 04:38 — forked from proofek/watchr.rb

Dependency "watchr":

sudo gem install watchr

On Macs:

sudo gem install growl

Uses notify-send on other systems than Mac.

@beberlei
beberlei / pr.md
Created December 4, 2012 21:01 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@beberlei
beberlei / tailrecursion.php
Created November 25, 2012 21:25 — forked from pkriete/gist:2425817
PHP Tail Recursion
<?php
class TailRecursion
{
public $func;
public $acc;
public $recursing;
public function tail()
{
return call_user_func_array($this->func, func_get_args());