Skip to content

Instantly share code, notes, and snippets.

@neilcamm
neilcamm / package.json
Last active July 30, 2018 15:44
Webpack config to compile Sass, ES6 and Vue Components. Implements PurgeCss to remove unused css classes
{
"name": "tbs4",
"version": "1.0.0",
"description": "A Twitter Bootstrap 4 starter theme",
"main": "index.js",
"scripts": {
"dev": "webpack",
"build": "webpack",
"watch": "webpack --watch",
"production": "cross-env NODE_ENV=production webpack"
// Conver scale factor into pixels
.fontScale(@scale: 0) {
@list: 14px, 16px, 20px, 24px, 28px, 34px, 41px, 50px, 60px;
.test-args(@scale) when (@scale >= -2) and (@scale <= 6) {
font-size: extract(@list, @scale + 3);
}
.test-args(@scale);
}
@sitefinitysteve
sitefinitysteve / wireUpGADocumentTracking.js
Created March 14, 2015 10:54
Sitefinity Google Analytics Document\Link Tracking Code
function wireUpGADocumentTracking() {
if ($("body.sfPageEditor").length == 0) {
var filetypes = /\.(zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i;
var baseHref = '';
if (jQuery('base').attr('href') != undefined) baseHref = jQuery('base').attr('href');
var hrefRedirect = '';
jQuery('#content-wrapper').on('click', 'a', function (event) {
var el = jQuery(this);
var track = true;
IMPORTANT
Please duplicate this radar for a Safari fix!
This will clean up a 50-line workaround.
rdar://22376037 (https://openradar.appspot.com/radar?id=4965070979203072)
//////////////////////////////////////////////////////////////////////////////
(Now available as a standalone repo.)