Skip to content

Instantly share code, notes, and snippets.

@marcelweder
marcelweder / ga.php
Last active September 14, 2016 06:25
Workaround to implement Google-Analytics script
<?php
/**
* Google-Analytics
* Do not forget to replace te ID (UA-00000000-0)
*/
$alternate = '(function(root){
root.GoogleAnalyticsObject = "ga";
root.ga = {q: [["create", "UA-00000000-0", "auto"]],l: 1 * new Date()};
})(this);';
@SimonWpt
SimonWpt / example.sass
Created May 26, 2012 19:50
SASS mixin graycity
img
// graycity($gray, $opacity)
@include graycity(0.5, 0.7)
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@alkos333
alkos333 / gist:1771618
Created February 8, 2012 17:52
Read URL GET variable
// Given a query string "?to=email&why=because&first=John&Last=smith"
// getUrlVar("to") will return "email"
// getUrlVar("last") will return "smith"
// Slightly more concise and improved version based on http://www.jquery4u.com/snippets/url-parameters-jquery/
function getUrlVar(key){
var result = new RegExp(key + "=([^&]*)", "i").exec(window.location.search);
return result && unescape(result[1]) || "";
}