Skip to content

Instantly share code, notes, and snippets.

@smhmic
smhmic / - README - URL parameter blocklist OR allowlist in GTM.md
Last active May 17, 2022 14:31
URL parameter blocklist/allowlist in GTM.md
@okabsd
okabsd / gta.source.js
Created February 28, 2016 18:20
Google Tag Assistant Source, Unminified
var h, aa = this,
k = function(a) {
return void 0 !== a
},
ba = function(a) {
a.R = function() {
return a.kb ? a.kb : a.kb = new a
}
},
ca = function(a) {
@thyngster
thyngster / GTMDebugOff.js
Created August 24, 2015 14:14
GTM Debug Disabler
document.querySelector('iframe[src*="about"]').contentWindow.angular.element(document.querySelector('iframe[src*="about"]').contentWindow.document.querySelector('[ng-app]')).injector().get("$log").debug = function(){};
@bennadel
bennadel / mixin-loop.css
Created June 5, 2014 21:33
Passing Rulesets To Mixins In Less CSS
span.alpha {
background-position: 0px 0px;
content: "alpha is the awesome";
border-top: 0px ;
}
span.beta {
background-position: 50px 0px;
content: "beta is the awesome";
}
span.theta {

Sass/CSS-Crush Comparison

This is an adaptation of the Sass/Less comparison document.

Not a comprehensive overview of features of either library but a comparison of commonalities.

Variables

Sass | Crush

@StefanoRausch
StefanoRausch / include-once.scss
Created September 28, 2013 17:51
Import Once Feature Implemented in Sass.
$is-included : () !default;
@mixin once( $name ) {
@if include-once( $name ) {
@content;
}
}
@function include-once( $name ) {
@if index( $is-included, $name ) {
define( 'CHILD_THEME_VERSION', filemtime( get_stylesheet_directory() . '/style.css' ) );
@vimishor
vimishor / date.php
Created December 18, 2012 22:17
The clean and fast way for changing date format in PHP
<?php
$date = new DateTime('now');
echo $date->format('d/m/Y').PHP_EOL; // format: day/month/year
echo $date->format('m-d-Y').PHP_EOL; // format: month-day-year
echo $date->format('Y-m-d').PHP_EOL; // format: year-month-day
// add 3 days to current date and output using format year-day-month
echo $date->setTimestamp( strtotime('+3 days', $date->getTimestamp()) )->format('Y-d-m');
@johnpbloch
johnpbloch / media-wut.js
Created December 18, 2012 17:01
Add a custom page to the new media manager in WordPress that only shows attachments uploaded to this post with no controls to change it. This is undoubtedly bad programming, but that javascript is a huge mess of undocumented code with little to no help in figuring out how to extend it.
(function($){
var media = wp.media,
jeditor = {
oldMainMenu : media.view.MediaFrame.Post.prototype.mainMenu,
init : function(){
media.view.MediaFrame.Post.prototype.mainMenu = function(view){
jeditor.oldMainMenu(view);
var jState = new media.controller.Library({
id: 'test',
library: media.query({uploadedTo: media.view.settings.post.id}),
@BaylorRae
BaylorRae / doc_block.php
Created July 17, 2012 20:38
Parse PHP Doc Blocks
<?php
class DocBlock {
public $docblock,
$description = null,
$all_params = array();
/**
* Parses a docblock;