Skip to content

Instantly share code, notes, and snippets.

View WizardOfArc's full-sized avatar

Azi Crawford WizardOfArc

View GitHub Profile
@WizardOfArc
WizardOfArc / progress_bar.php
Created December 6, 2012 00:34 — forked from shaneharter/gist:4211173
Progress Display for PHP CLI scripts
<?php
/**
* Azi modified Shane Harter's code to draw a progress bar
* feel free to use
**/
function progress ($step_x, $of_y, $label = '') {
$screen_width = `tput cols` - 2 ;
$fraction_done = $step_x / $of_y;
$percent_done = $fraction_done * 100;
@WizardOfArc
WizardOfArc / blinky.php
Created December 5, 2012 20:08 — forked from tim-trulia/blinky.php
A little cutesy command line animation
/**
* Blinky is a little ASCII animation inspired by
* Shane Harter's Progress Display for PHP CLI scripts
* see: https://gist.github.com/4211173
* this one is written by Azi Crawford forked by Tim Correia forked again by Azi Crawford
* 12/08/2012 -> added ears to blinky
**/
$blinks_array = array( '<O.O>', '<O.o>', '<O.->', '<O.o>', '<O.O>', '<o.O>', '<-.O>', '<o.O>', '<O.O>', '<o.o>', '<-.->', '<o.o>' );
define('SCREEN_WIDTH', `tput cols` - 2);