Skip to content

Instantly share code, notes, and snippets.

@jerclarke
jerclarke / Google_OAuth2.php
Last active February 17, 2018 19:40
Google_OAuth2.php from Google Analyticator v.6.4.3 with modifications to fix "Fatal error: Uncaught exception 'Google_AuthException'" See revision history for details on what I changed to fix the error. See this wordpress.org support forum posting about the issue: http://wordpress.org/support/topic/solution-for-fatal-error-uncaught-exception-goo…
<?php
/*
* Copyright 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
@nicdaCosta
nicdaCosta / DevToolsAPI.js
Created November 27, 2012 20:46
A basic interface for Developer Tools so that developers can register useful "snippets" that will thus be available for future use.
/*
* DevToolsAPI.js
* Author : Nic da Costa ( @nic_daCosta )
* Created : 2012/11/27
* Version : 0.1
* License : MIT, GPL licenses.
*
* Overview:
* script to possibly be included in DevTools.js ( Chrome Dev Tools ) to give a
* basic "interface" for developers to register scripts / functions for repeated use.
@spdustin
spdustin / tasks-sample.xml
Created October 29, 2012 19:52
XML Sample Tasks
<dsQueryResponse BaseViewID="1" RowLimit="30" TemplateType="107" ViewStyleID="">
<Rows>
<Row AssignedTo="&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; &gt;
&lt;tr&gt;
&lt;td style=&quot;padding-right: 3px;&quot;&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;" AssignedTo.id="" AssignedTo.span="&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; &gt;
&lt;tr&gt;
&lt;td style=&quot;padding-right: 3px;&quot;&gt;
@spdustin
spdustin / xsl-step-2.xsl
Created October 29, 2012 16:25
XSL Step 2
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes" indent="yes" />
<xsl:template match="/">
<table>
<thead>
<tr>
<th>Make</th>
<th>Model</th>
@spdustin
spdustin / snippet.xml
Created October 29, 2012 15:50
XML Sample
<cars>
<car make="Ford" model="Pinto">
<passenger name="Dustin" />
<passenger name="Graham" />
</car>
<car make="Toyota" model="Prius" />
<car make="Nissan" model="Sentra" />
</cars>
@media only screen and (min-width: 320px) {
/* Small screen, non-retina */
}
@media
only screen and (-webkit-min-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( min--moz-device-pixel-ratio: 2) and (min-width: 320px),
only screen and ( -o-min-device-pixel-ratio: 2/1) and (min-width: 320px),
<ul>
<li class="month">October</li>
<li class="day">30</li>
<li class="year">2012</li>
</ul>
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@pamelafox
pamelafox / touch.js
Created March 26, 2012 17:31
Touch Events
dom.each(function() {
$(this).unbind('tap', callback);
$(this).bind('tap', callback);
$(this).bind('touchstart', function(e) {
e.preventDefault();
var item = e.currentTarget;
if (ISTOUCHING) return;
item.moved = false;
@scottkellum
scottkellum / normalized.html
Created December 6, 2011 14:58
pixel normalization
<!doctype html>
<html>
<head>
<!-- Encoding -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"></meta>