Related Posts
My First Raspberry PI Project: DIY ARM Video Game Console.
I got everything on amazon, didn’t pay for shipping (Prime member): So far I bought: – Raspberry PI ($48) – Raspberry PI case ($14) – Power adapter ($2.25) – SNES-like Controller with USB jack ($10.75) – SanDisk SDHC 16GB class 6 (30mb/s) ($15) I first intend to install Ubuntu ARM along with several video game […]
ubuntu packages for a kick ass web server
Copy and paste the following list on a file, say “packages.txt”. To install all just do: sudo apt-get install $(cat packages.txt) accountsservice acpid adduser ant ant-optional apache2-utils apparmor apport apport-symptoms apt apt-transport-https apt-utils apt-xapian-index aptitude at base-files base-passwd bash bash-completion bc bind9-host bsdmainutils bsdutils busybox-initramfs busybox-static byobu bzip2 ca-certificates ca-certificates-java cloud-init cloud-initramfs-growroot cloud-initramfs-rescuevol cloud-utils command-not-found […]
[CODE/PHP] JpGraph: How to output your graph as a base64 encoded image
Some times you just want to output the image created by your $graph object without having to create a separate .php script that would need to receive a bunch of parameters. Here’s a function you can pass your $graph object right before the $graph->Stroke(); call [pastacode lang=”php” manual=”function%20graphInSrc(%24graph%2C%20%24width%2C%20%24height)%20%7B%0A%20%20%24img%20%3D%20%24graph-%3EStroke(_IMG_HANDLER)%3B%0A%20%20ob_start()%3B%0A%20%20imagepng(%24img)%3B%0A%20%20%24img_data%20%3D%20ob_get_contents()%3B%0A%20%20ob_end_clean()%3B%0A%0A%20%20echo%20’%3Cimg%20width%3D%22′.%24width.’%22%20height%3D%22′.%24height.’%22%20src%3D%22data%3Aimage%2Fpng%3Bbase64%2C’.base64_encode(%24img_data).’%22%2F%3E’%3B%0A%7D” message=”” highlight=”” provider=”manual”/]
