Skip to content

Instantly share code, notes, and snippets.

View enovision's full-sized avatar
💪
Feeling great!

Enovision IT & Web Services enovision

💪
Feeling great!
View GitHub Profile
@enovision
enovision / gist:5c547d0d2be1bb4520f72a738d76aba7
Created October 10, 2020 09:43
ZPL dpi converter for PHP
<?php
/*
* author: Tres Finocchiaro transposed to PHP by Johan van de Merwe
* date: 2020-08-10
* license: Public Domain; Use as you wish.
* source: http://qz.io
*
* usage:
*
* $data = '^XA...your zpl data.. XZ';
@enovision
enovision / ajax.js
Created February 27, 2020 16:54 — forked from franz-josef-kaiser/ajax.js
AJAX in WordPress. Class based example.
( function( $, plugin ) {
"use strict";
// Working with promises to bubble event later than core.
$.when( someObjectWithEvents ).done( function() {
console.log( 'AJAX request done.' );
} )
.then( function() {
setTimeout( function() {
console.log( 'AJAX requests resolved.' );
@enovision
enovision / Iterate an Ext JS 4 store
Created June 11, 2013 10:52
Iterating a Ext JS 4 store. How to go through every record of Ext JS store
/*
In the functoin below you have to find your store
in your own object. If the function below is in a grid class
you can use it as it is put here
I like to keep things clear, therefor I address every object
in a seperate field for clarity.
*/
function IterateThisStore() {
@enovision
enovision / W2UI Grid Toolbar
Created June 6, 2013 21:52
W2UI Framework - Toolbar handler. A button click is handled on the toolbar (target = id of the button, data = the event object)
jQuery('#grid').w2grid({
name: 'grid',
recordsPerPage: 25,
fixedRecord: false,
url: '/wp-content/plugins/GarageSoftware/ajax/AjaxLoadOccasions.php',
show: {
header: true,
footer: true,
toolbar: true
},
@enovision
enovision / unzip.php
Created March 1, 2013 14:29
Unzip.php - Unzip zip file on the web server faster (see first comment for usage)
<?php
if (isset($_POST['zip_file'])) {
$filename = $_POST['zip_file'];
$source = $_POST['zip_file'];
$type = 'zip';
$name = explode(".", $filename);
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed');
@enovision
enovision / zipper.php
Created March 1, 2013 14:25
Script for uploading ZIP file and unzip it on the server (see first comment for usage)
<?php
/* Simple script to upload a zip file to the webserver and have it unzipped
Saves tons of time, think only of uploading Wordpress to the server
Thanks to c.bavota (www.bavotasan.com)
I have modified the script a little to make it more convenient
Modified by: Johan van de Merwe (12.02.2013)
*/
function rmdir_recursive($dir) {
foreach (scandir($dir) as $file) {