xaizek / rocketgit (License: AGPLv3+) (since 2018-12-09)
Light and fast Git hosting solution suitable to serve both as a hub or as a personal code storage with its tickets, pull requests, API and much more.
<root> / inc / gd.inc.php (92b15915231d593a3ddfde16c6394e70ba88de26) (985B) (mode 100644) [raw]
<?php


/*
 * Creates a graphic
 */
function rg_gd_graph($a)
{
	$i = imageCreateTrueColor($a['w'], $a['h']);
	if ($i === FALSE)
		return FALSE;

	imageSaveAlpha($i, TRUE);

	if (isset($a['bg'])) {
		$c = $a['bg'];
		$bg = ImageColorAllocate($i, $c['r'], $c['g'], $c['b']);
		imageFill($i, 0, 0, $bg);
	}


	// How many seconds?
	$secons = $a['end'] - $a['start'] + 1;

	// one vertical line means how many seconds?
	$colums = intval($seconds / $a['seconds_per_column']);

	$line = 0;
	// Draw title
	if (isset($a['title_color']))
		$c = $a['title_color'];
	else
		$c = array("r" => 0, "g" => 0, "b" => 255);
	$tc = imageColorAllocate($i, $c['r'], $c['g'], $c['b']);
	imageString($i, 4, 3, $line, $a['title'], $tc);
	$line += 20;

	// main rectangle
	if (isset($a['border_color']))
		$c = $a['border_color'];
	else
		$c = array("r" => 0, "g" => 0, "b" => 0);
	$bc = imageColorAllocate($i, $c['r'], $c['g'], $c['b']);
	imageRectangle($i, 0, $line, $a['w'] - 1, $a['h'] - 1, $bc);

}

?>
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/rocketgit

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/rocketgit

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master