Skip to content

Instantly share code, notes, and snippets.

View robertpop's full-sized avatar
🎯
Focusing

Robert robertpop

🎯
Focusing
View GitHub Profile
@Rooke
Rooke / refresh_example.html
Last active June 8, 2020 20:49
An example DFP implementation using refresh and disableInitialLoad
<!DOCTYPE html>
<html>
<head>
<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
</script>
<script>
@VijayaSankarN
VijayaSankarN / str_replace_n.php
Last active June 18, 2023 14:43
String replace nth occurrence using PHP
<?php
/**
* String replace nth occurrence
*
* @param type $search Search string
* @param type $replace Replace string
* @param type $subject Source string
* @param type $occurrence Nth occurrence
* @return type Replaced string
*/
@jonathanbardo
jonathanbardo / reverse-wpautop.php
Last active December 29, 2018 20:00
Opposite of wpautop
<?php
/**
* Do the opposite of wpautop
*
* @param string $s
*
* @return string
*/
public static function reverse_wpautop( $s ) {
@a-vasyliev
a-vasyliev / example.com.conf
Created March 25, 2015 11:42
Nginx: proxy cache without utm_* parameters (remove query parameter, remove utm tags nginx)
server {
listen 443;
server_name example.com;
error_log /var/log/nginx/example_com_error.log warn;
ssl on;
ssl_certificate /etc/nginx/ssl/your.crt; #certificate chains
ssl_certificate_key /etc/nginx/ssl/your.key; #private key
@kevinlisota
kevinlisota / google-analytics-author-tracking.php
Last active November 1, 2024 15:50
add WordPress author tracking using Google Analytics custom dimension
//Google Universal Analytics
function google_analytics() { ?>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'YOUR ANALYTICS PROPERTY ID HERE', 'auto');
<?php if (is_singular('post') :
@ChaseWiseman
ChaseWiseman / load-modal.js
Last active November 23, 2019 17:02
Load modals as WordPress template parts via AJAX
$( function() {
var loadModal = function( modal ) {
$.post(
pinwheel_modals.ajax_url,
{
action: 'load_modal',
modal: modal
},
function exportFileToPNG(dest, artBoardIndex)
{
var exportOptions = new ExportOptionsPNG24(); // or ExportOptionsPNG8
var type = ExportType.PNG24; // or ExportType.PNG8
var file = new File(dest + ".png");
exportOptions.artBoardClipping = true;
exportOptions.antiAliasing = true;
exportOptions.transparency = true;
exportOptions.qualitySetting = 72;
# add the email package
meteor add email
<template name="ForgotPassword">
<form action="/forgot" id="forgotPasswordForm" method="post">
<input id="forgotPasswordEmail" type="text" name="email" placeholder="Email Address">
<input class="btn-submit" type="submit" value="Send">
</form>
<!-- end #forgot-password-form -->
</template>
@impressivewebs
impressivewebs / SassMeister-input.scss
Created March 8, 2014 00:14
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.5)
// Compass (v1.0.0.alpha.18)
// Bootstrap Sass (v3.1.1.0)
// ----
@import "bootstrap";
// Author Bio and Author Name are just Bootstrap .row elements
.author-bio,