Skip to content

Instantly share code, notes, and snippets.

View timwburch's full-sized avatar

Tim Burch timwburch

View GitHub Profile
@timwburch
timwburch / index.html
Last active April 11, 2018 01:01
weather API
<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 April 19, 2017 23:49 — forked from danburzo/README.md
Get all event listeners on the page in Google Chrome
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] };
})
};
@timwburch
timwburch / gist:cf43983b8a213ec972103bf93487083f
Created September 15, 2016 23:48 — forked from liamcurry/gist:2597326
Vanilla JS vs jQuery

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
// 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 April 30, 2022 01:45
Simple Google Script to GeoCode from address in cell
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 February 4, 2018 19:12
Gravity Forms shuffle fields on current page only
<?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 October 19, 2017 22:33
Get CSS Style Property with Javascript
// 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