Skip to content

Instantly share code, notes, and snippets.

@primozcigler
primozcigler / class-pt-customize-control-range.php
Created March 17, 2015 10:07
Footer widgets layout customizer control.
<?php
/**
* Range Control Class
*/
class WP_Customize_Range_Control extends WP_Customize_Control {
/**
* @access public
* @var string
@primozcigler
primozcigler / libela-elsi-g-325-weight.py
Created December 19, 2020 21:46
Sample code for serial (RS-232) connection between computer and Libela Elsi G 325 retail scale/weight
import serial
"""
Tehtnica: Libela Elsi G 325 (https://www.libela-elsi.si/en/retail-scales/retail-scales-without-printer/)
Protokol: TISA-4 (0)
https://pypi.org/project/pyserial/
https://pyserial.readthedocs.io/en/latest/shortintro.html
Podatki za povezavo s tehtnice: 9600 8 N 1
@primozcigler
primozcigler / themeforest-contract.md
Last active August 19, 2021 02:41 — forked from malarkey/Contract Killer 3.md
Modified version of @malarkey's Killing Contract for use for the ThemeForest cooperation (more dev to dev team than dev to client).

Contract for developing a Drupal theme for selling on the ThemeForest

Between us: [ProteusNet d.o.o., Rudarska cesta 11, 8281 Senovo, Slovenia, EU] and you: [partner]

Summary:

We’ll always do our best to fulfil the scope of this cooperation, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

So in short;

@primozcigler
primozcigler / trello-changelog.js
Last active November 22, 2018 09:00
Trello changelog in console
(function() {
'use strict';
var changelog = [];
var date = new Date();
var padLeft = function ( str ) {
var pad = '00';
return pad.substring(0, pad.length - str.length) + str;
};
@primozcigler
primozcigler / sum-templatemonster-sales-chrome-snippet.js
Last active March 2, 2018 11:49
Sum billing report values from templatemonster chrome snippet
// Go to https://account.templatemonster.com/#/billing and scroll down to show enough BILLING HISTORY items
// Then run the script
{
const dateRegex = /aug \d+, 2017/i
// startDate = new Date('2017-8-1 00:00:00'),
// endDate = new Date('2017-9-1 00:00:00'),
allRows = Array.from($$( '.billing-history-operation' ));
@primozcigler
primozcigler / show_releases_from_to.sh
Last active February 3, 2017 17:01
Show all theme releases from the last month. The script should be placed in wp-content/themes/ and your themes should have .git/ in root.
#!/bin/bash
#
# Gist: https://gist.github.com/primozcigler/e816919feea345ca393dc4ae90a872fd
# How to use it: https://primoz.blog/simple-bash-script-can-tell-releases-given-date-period/
if [[ $# -ne 2 ]]; then
echo "usage: $0 <start date> <end date>"
echo "<date> in format 'YYYY-MM-DD'"
exit
fi
@primozcigler
primozcigler / actions.php:513
Last active December 9, 2016 09:19
proposed change for edd-vat wp plugin
// https://support.cloudflare.com/hc/en-us/articles/200168236-What-does-CloudFlare-IP-Geolocation-do-
if ( apply_filters( 'edd_vat_use_cf_ip_header', false ) && ! empty( $_SERVER['HTTP_CF_IPCOUNTRY'] ) && 'XX' !== $_SERVER['HTTP_CF_IPCOUNTRY'] )
{
$this->ip_address_country = $_SERVER['HTTP_CF_IPCOUNTRY'];
return $this->ip_address_country;
}
@primozcigler
primozcigler / pt-working-hours.html
Last active October 31, 2016 08:36
ProteusThemes support working hours widget. Made with moment.js
<html>
<head>
<title>support opening time</title>
<!-- deps: jquery, underscore.js, moment.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.4.0/moment.min.js"></script>
<script>
jQuery( document ).ready( function ( $ ) {
/**
@primozcigler
primozcigler / marko-learning.md
Last active December 30, 2015 17:59
Learning course for the new coworker Marko

Naloge

Ta teden bo predvsem poudarek na SASS in JavaScript. Če boš tako hiter kot na začetku, potem se proti koncu tedna bolj resno lotiva Grunt, Bower in ostalih CLI orodij.

Ta fajl bom updateal tekom tedna za vsak dan, glede na napredek.

JavaScript

V tem delu se boš spoznal z osnovami JavaScripta. Poudarek bo na jQuery, ker boš to sigurno potreboval.

@primozcigler
primozcigler / tooling.md
Last active December 29, 2015 11:39
My tooling, the tools I use for the advanced web development which make my life easier

On my tooling

I usually send this file if someone is working on the same code as I do. Just a quick overview of my tooling. Hard punishment for the guys which don't listen to me.

Command line tools