[ad_1]
Developer Andrew Schmelyun has discovered a novel use for a receipt printer: turning GitHub Points into bodily tickets, simply seen even when entry to GitHub is not out there.
“I’ve plenty of aspect initiatives on GitHub,” Schmelyun explains. “I have been sometimes writing new points down on sticky notes at any time when I see a notification for a problem, however I all the time wished an excuse to streamline the method a bit extra. After seeing a receipt printer spitting out orders whereas grabbing some take-out the opposite day, I puzzled if I may use one to print out a ticket every time a problem was added to one in every of my repos.”
To drive the system, Schmelyun opted for the low-cost low-power Raspberry Pi Zero W single-board laptop, powered through USB. To this, he related an off-the-shelf Epson TM-T88IV receipt printer, suitably loaded with thermal paper.
“The rationale that I went with an Epson thermal printer is that they use the ESC/POS command set, for which there’s established libraries in a wide range of programming languages,” Schmelyun says. “Plus they’re fairly ubiquitous within the second-hand market, and I used to be in a position to choose one up on Ebay together with some receipt paper for a reasonably truthful worth.”
A PHP server working on the Raspberry Pi, tunneled through ngrok to keep away from having to show the server publicly, acts as the tip level for a webhook on GitHub — triggered when a brand new concern is filed. A JSON file offered by GitHub is decoded for related particulars, and the outcome neatly formatted and printed fully mechanically.
The printer mechanically prompts, through webhook, when a brand new GitHub Subject is filed. (📷: Andrew Schmelyun)
“That is undoubtedly a easy proof of idea, however we will increase on it just a few other ways,” Schmelyun says. “For the tickets themselves, a QR code could possibly be added to hyperlink on to the difficulty on GitHub. You can additionally add in additional particulars from the difficulty itself like tags and severity.
“You can additionally use this idea to deal with principally any knowledge coming from a webhook or by means of an API request. Like printing tickets from apps like Jira or Bugsnag, exceptions thrown from manufacturing purposes, and even every day to-do objects and grocery lists!”
A full write-up of the undertaking is obtainable on Schmelyun’s web site, whereas the supply code has been revealed to — the place else — GitHub below an unspecified open supply license.
[ad_2]
