Skip to content

Instantly share code, notes, and snippets.

Christopher Shroba chrisshroba

Block or report user

Report or block chrisshroba

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View progress_bar.sh
#!/usr/bin/env bash
COLUMNS=$(tput cols)
for i in $(seq 1 $((COLUMNS - 2)))
do
echo -ne "\033[2K\r"
echo -n "["
yes = | head -n $i | tr -d "\n"
if [ $((COLUMNS - 2 - i)) != 0 ]
then
yes " " | head -n $((COLUMNS - 2 - i)) | tr -d "\n"
View progress_bar.sh
#!/usr/bin/env bash
COLUMNS=$(tput cols)
echo $COLUMNS
for i in $(seq 0 $((COLUMNS - 2)))
do
echo -ne "\033[2K\r"
echo -n "["
yes = | head -n $i | tr -d "\n"
if [ $((COLUMNS - 2 - i)) != 0 ]
then
View static_server.js
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
You can’t perform that action at this time.