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
from PIL import Image | |
# Partially inspired by https://stackoverflow.com/a/30228308/2237660 | |
# images: list() of PIL.Image.Image | |
# stack: False=> append horizontally (side-by-side), True=> append vertically (stacking bottom-to-up) | |
# bgcolor: final image background color. Default: white | |
def append_images(images, stack=False, bgcolor='white'): | |
# sanity checks | |
if not isinstance(images, list): | |
return False |
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
def array_chunk(arr, size): | |
chunks=[arr[x:x+size] for x in xrange(0, len(arr), size)] | |
return chunks |
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
#!/bin/bash | |
#IMG_DIR=${HOME}/.unsplash | |
IMG_DIR=/home/fabiano/.unsplash | |
URL="http://source.unsplash.com/random" | |
DATE_TIME=$(LANG=C date +%F_%T | sed 's/:/./g') | |
IMG=${IMG_DIR}/${DATE_TIME}.jpg | |
if [ ! -d ${IMG_DIR} ]; then | |
mkdir ${IMG_DIR} |
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
#!/bin/bash | |
GZ_LIST="*gz" | |
for GZ_FILE in ${GZ_LIST} | |
do | |
echo "Processing file ${GZ_FILE}" | |
FILENAME="${GZ_FILE%.*}" | |
gunzip -c ${GZ_FILE} | xz -3vv -c > ${FILENAME}.xz | |
RES=$? | |
touch -r ${GZ_FILE} ${FILENAME}.xz | |
if [ $? -eq 0 ]; then |
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 | |
/** | |
* QR Code + Logo Generator | |
* | |
* http://labs.nticompassinc.com | |
*/ | |
$data = isset($_GET['data']) ? $_GET['data'] : 'http://labs.nticompassinc.com'; | |
$size = isset($_GET['size']) ? $_GET['size'] : '200x200'; | |
$logo = isset($_GET['logo']) ? $_GET['logo'] : FALSE; |
NewerOlder