Skip to content

Instantly share code, notes, and snippets.

View uschmelzer's full-sized avatar

Uwe Schmelzer uschmelzer

View GitHub Profile
{
"html_attributions" : [],
"results" : [
{
"formatted_address" : "101 Plaza Center, Secaucus, NJ 07094, United States",
"geometry" : {
"location" : {
"lat" : 40.79164149999999,
"lng" : -74.0568873
},
@uschmelzer
uschmelzer / dabblet.css
Created November 7, 2018 14:31 — forked from wrumsby/dabblet.css
Using images for checkboxes and radiobuttons
/**
* Using images for checkboxes and radiobuttons
*/
body {
background-color: #fff;
color: #333;
font-family: "Open Sans", Arial, Helvetica, sans-serif;
line-height: 1.6;
}
<?php
//set up pods::find parameters to limit to 5 items
$param = array(
'limit' => 5,
);
//create pods object
$pods = pods('pod_name', $params );
//check that total values (given limit) returned is greater than zero
if ( $pods->total() > 0 ) {
@uschmelzer
uschmelzer / isElementInViewport.js
Created June 15, 2017 19:55 — forked from davidtheclark/isElementInViewport.js
JavaScript: Is element in viewport?
/*
No jQuery necessary.
Thanks to Dan's StackOverflow answer for this:
http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport
*/
function isElementInViewport(el) {
var rect = el.getBoundingClientRect();
return (
rect.top >= 0 &&
@uschmelzer
uschmelzer / onViewport.js
Created June 15, 2017 19:46 — forked from eltonmesquita/onViewport.js
A simple jQuery function that adds a class when the target(s) is in the viewport
function onViewport(el, elClass, offset, callback) {
/*** Based on http://ejohn.org/blog/learning-from-twitter/ ***/
var didScroll = false;
var this_top;
var height;
var top;
if(!offset) { var offset = 0; }
$(window).scroll(function() {