Skip to content

Instantly share code, notes, and snippets.

View parrfolio's full-sized avatar
My God, It's Full of Stars

Ryan Parr parrfolio

My God, It's Full of Stars
View GitHub Profile
@parrfolio
parrfolio / find-in-json.js
Created January 9, 2016 16:43 — forked from iwek/find-in-json.js
Searching through JSON
//return an array of objects according to key, value, or key and value matching
function getObjects(obj, key, val) {
var objects = [];
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
if (typeof obj[i] == 'object') {
objects = objects.concat(getObjects(obj[i], key, val));
} else
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not)
if (i == key && obj[i] == val || i == key && val == '') { //
@parrfolio
parrfolio / slideshow.html
Created June 24, 2012 23:11 — forked from kara-ryli/slideshow.html
A Webkit-only version of Jonathon Snook's "Simplest jQuery Slideshow" that meets his requirements (concise, less than 20 lines) without requiring jQuery.
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Simplest jQuery Slideshow</title>
<style>
body { font-family:Arial, Helvetica, sans-serif; font-size:12px; }
.fadein { position:relative; height:332px; width:500px; }
.fadein img { position:absolute; left:0; top:0;}
.fadein.ready img { -webkit-transition: opacity 1s linear;}
</style>