Skip to content

Instantly share code, notes, and snippets.

@vielhuber
vielhuber / index.php
Last active September 24, 2021 00:58
progress bar echo load loading cli #php
<?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).'%',
@TrevorJTClarke
TrevorJTClarke / BrowserDeviceInfo.js
Created September 1, 2015 17:52
A quick list of browsers and devices for use in testing. Chrome is used for all devices that need simulation.
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' },
@frowing
frowing / hack.sh
Created December 6, 2012 06:45 — forked from amrox/hack.sh
OSX For Hackers
#!/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
#