Skip to content

Instantly share code, notes, and snippets.

@thomascube
thomascube / image2grf.php
Created July 11, 2018 08:02
PHP function to convert a PNG image to a .GRF file for use with Zebra printers
<?php
/**
* Converts a PNG image to a .GRF file for use with Zebra printers
*
* The input is preferably a 1-bit black/white image but RGB images
* are accepted as well.
*
* This function uses PHP's GD library image functions.
*
@thomascube
thomascube / app.js
Created January 4, 2020 13:53
Automated Docker builds with Google cloud functions
const bent = require('bent');
const httpJSON = bent('json');
const admin = require('firebase-admin');
const DOCKER_BUILD_TRIGGER = 'https://hub.docker.com/api/build/v1/source/<this-is-secret>/trigger/<another-secret>/call/';
const BUILD_TAGS = {
'1.3.x-apache': '7.2-apache',
'1.3.x-fpm': '7.2-fpm',
'1.3.x-fpm-alpine': '7.2-fpm-alpine',
'1.4.x-apache': '7.3-apache',
'1.4.x-fpm': '7.3-fpm',