Skip to content

Instantly share code, notes, and snippets.

Tim Burch timwburch

  • Sydney Australia
Block or report user

Report or block timwburch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<div class="geo-card weather">
<p class="report" id="weatherReport"></p>
<div class="image">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWQAAAFuCAYAAAC2gGJGAAAgAElEQVR4nOy9WZskx3EteMzcIyIza+tGryCxi4Sgq0vOULqSZubpzv/XkzQj6SNFUiJBESRIAN21ZEaEm9k8mHlEVHX1hoXs+00YWejurMzIWNyPHzu2OLDaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222mqrrbbaaqutttpqq6222p/Z6M99Ai+yf/zHfwQz4+zsDPfv38fx8TH6vsdvfvMb/PznP8fTp08BACklEF2/FDO79ufN36kqSinIOePBgwf45JNP8ODBAwxjwdOn5zg/f4q+HwAY6qHVFCICGNA2DU5PT3F8fITdbothGPDLX/wCv/j5z3F5foGmaZCaBgbADLDFcYjo+p0nwNSg6n+KKIgY77//Lv7mJ3+DzXaDq8MVfv/5H3H+9BzjWADz81cVnJyd4eGjRzg7OYGK4tNPf4t/+Zd/xa9//Z/Y769wfHSEu3fvpKOjXSZCLqUkguXcpMSJkogkVc2ZMx9td2m32SQz48u
@timwburch
timwburch / event-listeners.js
Created Apr 19, 2017 — forked from danburzo/event-listeners.js
Get all event listeners on the page in Google Chrome
View event-listeners.js
var items = Array.prototype.slice.call(
document.querySelectorAll('*')
).map(function(element) {
var listeners = getEventListeners(element);
return {
element: element,
listeners: Object.keys(listeners).map(function(k) {
return { event: k, listeners: listeners[k] };
})
};
View gist:cf43983b8a213ec972103bf93487083f

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
View checkjQuery.js
// Check that jQuery is
// loaded with an upper limit
// for the number of calls.
function checkjQuery(upper) {
if (typeof jQuery != 'undefined') {
jQuery(document).ready(function () {
// jQuery dependant function
});
} else {
@timwburch
timwburch / Google Spreadsheet GeoCode.js
Last active Aug 2, 2019
Simple Google Script to GeoCode from address in cell
View Google Spreadsheet GeoCode.js
function getGeocodingRegion() {
return PropertiesService.getDocumentProperties().getProperty('GEOCODING_REGION') || 'au';
}
function addressToPosition() {
// Select a cell with an address and two blank spaces after it
var sheet = SpreadsheetApp.getActiveSheet();
var cells = sheet.getActiveRange();
var addressColumn = 1;
@timwburch
timwburch / gf_page_fields_shuffle.php
Last active Feb 4, 2018
Gravity Forms shuffle fields on current page only
View gf_page_fields_shuffle.php
<?php
/**
* Gravity Forms Shuffle fields on current page.
* To impliment add this to your functions.php file
* adding the form id will isolate the filter e.g. add_filter( 'gform_pre_render_5', 'randomize_field_order');
*/
add_filter( 'gform_pre_render', 'randomize_field_order');
@timwburch
timwburch / propertyFromStyleSheet.js
Last active Oct 19, 2017
Get CSS Style Property with Javascript
View propertyFromStyleSheet.js
// This function will return css text of a supplied css selector (must match exactly) or
// it will return the property defined in the second argument. Properties are individual
// properties not combined properties.
//
// propertyFromStylesheet('some selector', 'some property');
//
// modified from http://stackoverflow.com/a/16779622
You can’t perform that action at this time.