Skip to content

Instantly share code, notes, and snippets.

@johndatserakis
johndatserakis / docker-cleaning.sh
Last active May 3, 2020 20:11
Bash command to clean unused docker images and solve the max depth exceeded error.
# Getting a "max depth exceeded" error in your docker-compose file? Run these commands to clean our your docker install.
# Stop all running containers
docker stop $(docker ps -aq)
# Delete all docker containers
docker rm $(docker ps -a -q)
# Delete all docker images
docker rmi $(docker images -q)
@crittermike
crittermike / wget.sh
Last active March 12, 2026 20:31
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@arjenblokzijl
arjenblokzijl / convert-csv-file-to-php-associative-array.php
Last active July 30, 2020 19:55
Convert CSV file to PHP associative array
<?php
/* Thanks to http://steindom.com/articles/shortest-php-code-convert-csv-associative-array */
ini_set('auto_detect_line_endings', TRUE);
$rows = array_map('str_getcsv', file('myfile.csv'));
$header = array_shift($rows);
$csv = array();
foreach ($rows as $row) {
@coolaj86
coolaj86 / gist:2332953
Last active December 14, 2024 22:52
Dimensions for VistaPrint business cards
Standard
Bleed Margin: 90mm x 52mm
Content Ends: 87mm x 49mm
Imperial
Bleed Margin: 3.54in x 2.05in
Content Ends: 3.43in x 1.93in