This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/3999124/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var devices = [ | |
{ name: 'Desktop - Huge', width: 2880, height: 1800, ratio: 2, type: 'desktop' }, | |
{ name: 'Desktop - Extra Large', width: 1920, height: 1080, ratio: 1, type: 'desktop' }, | |
{ name: 'Desktop - Large', width: 1440, height: 900, ratio: 1, type: 'desktop' }, | |
{ name: 'Desktop - HiDPI', width: 1366, height: 768, ratio: 1, type: 'desktop' }, | |
{ name: 'Desktop - MDPI', width: 1280, height: 800, ratio: 1, type: 'desktop' }, | |
{ name: 'Laptop with HiDPI screen', width: 1440, height: 900, ratio: 2, type: 'desktop' }, | |
{ name: 'Laptop with MDPI screen', width: 1280, height: 800, ratio: 1, type: 'desktop' }, | |
{ name: 'Laptop with touch', width: 1280, height: 950, ratio: 1, type: 'desktop' }, | |
{ name: 'Tablet - Portrait', width: 768, height: 1024, ratio: 1, type: 'tablet' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function progress($done, $total, $info = '', $width = 50, $char = '=') { | |
$perc = round($done * 100 / $total); | |
$bar = round(($width * $perc) / 100); | |
echo sprintf( | |
"%s[%s%s] %s\r", | |
$info != '' ? $info.' ' : '', | |
str_repeat($char, $bar).($perc < 100 ? '>' : ''), | |
$perc == 100 ? $char : str_repeat(' ', $width-$bar), | |
str_pad($perc, 3, ' ', STR_PAD_LEFT).'%', |