Skip to content

Instantly share code, notes, and snippets.

@primozcigler
primozcigler / usage.js
Last active Aug 29, 2015
UTM link decorator, AMD module. It decorates all your links you pass with the current UTM parameters from URL.
View usage.js
require( [ 'jquery', 'utm-decorator' ] , function ( $, Decorator ) {
'use strict';
// decorate all links to themeforest and to our demo page on page load
$( function() {
var utmDecorator = new Decorator;
$( '[href*="themeforest.net"], [href*="proteusthemes.com"]' ).each( function ( index, $el ) {
utmDecorator.decorate( $el );
} );
} );
@primozcigler
primozcigler / zendesk-api-script.js
Last active Aug 29, 2015
Using Zendesk API for article in multiple sections
View zendesk-api-script.js
// fix to display general questions in themes' sections
// using Zendesk API
// @link https://developer.zendesk.com/rest_api/docs/help_center/articles#list-articles
(function() {
if ( $( '.breadcrumbs a[href*="200506781"]' ).length ) { // 200506781 is ID of the section for general questions
var config = {
$articleList: $( 'ul.article-list' ),
tmpl: _.template( '<li><a href="<%= url %>"><%- title %></a></li>' ),
apiUrl: 'https://proteusthemes.zendesk.com/api/v2/help_center/sections/200132421/articles.json',
};
@primozcigler
primozcigler / http2hosting-specs.md
Last active Aug 29, 2015
http2hosting.com specs
View http2hosting-specs.md

Overview

HTTP2hosting.com is a website where users can find a list of all the providers (hosting companies) which provide hosting on a new HTTP/2 protocol.

This spec is not, by any stretch of the imagination, complete. All of the wording will need to be revised several times before it is finalized. The graphics and layout of the screens is shown here merely to illustrate the underlying functionality. The actual look and feel will be developed over time with the input of graphics designers and iterative user feedback.

This spec simply discusses what the user sees when they interact with HTTP2hosting.com.

Scenarios

@primozcigler
primozcigler / hightligh-day.js
Created Nov 30, 2015
highlight current day
View hightligh-day.js
// ==========
// = Highlight current date =
// ==========
(function() {
var
timeTable = $('.js--timetable'),
date = new Date();
if(timeTable.length > 0) {
date = date.getDay();
timeTable.children('[data-day="'+date+'"]').addClass('today');
@primozcigler
primozcigler / rules.md
Last active Dec 28, 2015
Coding rules and patterns
@primozcigler
primozcigler / .gitignore
Last active Dec 29, 2015
My talks notes from WordCamp London 2013
@primozcigler
primozcigler / tooling.md
Last active Dec 29, 2015
My tooling, the tools I use for the advanced web development which make my life easier
View tooling.md

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

Yeoman

@primozcigler
primozcigler / marko-learning.md
Last active Dec 30, 2015
Learning course for the new coworker Marko
View marko-learning.md

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 / pt-working-hours.html
Last active Oct 31, 2016
ProteusThemes support working hours widget. Made with moment.js
View pt-working-hours.html
<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 / actions.php:513
Last active Dec 9, 2016
proposed change for edd-vat wp plugin
View actions.php:513
// 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;
}