Skip to content

Instantly share code, notes, and snippets.

View ryoungz's full-sized avatar

Robert Young ryoungz

View GitHub Profile
@ryoungz
ryoungz / coupon.js
Last active April 22, 2016 12:56
Functionality for list group menu used to select coupon categories and then load coupons using ajax assigned to the selected categories.
//parse query string value from URL
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split('&');
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (pair[0] === variable) {
return pair[1];
}
@ryoungz
ryoungz / Custom-Bullet-Points.markdown
Created February 11, 2015 14:08
Custom Bullet Points
<!DOCTYPE html>
<head>
<title>On page highlighting</title>
<style type="text/css">
.effect
{
-webkit-box-shadow: 0 10px 6px -6px #777;
-moz-box-shadow: 0 10px 6px -6px #777;
box-shadow: 0 10px 6px -6px #777;
}
@ryoungz
ryoungz / randomize.php
Created August 11, 2013 15:06
Randomizing text in an array
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="problems.css" />
<title>Randomizing data in an array</title>
</head>
<body>
<h2>Randomizing data in an array</h2>
@ryoungz
ryoungz / code.gs
Created August 4, 2013 19:29
Google Spreadsheet to Google Maps exercise for Code Challenge #1
// The name of the spreadsheet from the browser location bar.
// Copy after 'key=' until before the next URL parameter beginning w/&
var SPREADSHEET_ID = '0AlwGAPH865x-dG55Y3A4STE3N3d1d1RsX0EtblB3elE';
// The name of the sheet, displayed in a tab at the bottom of the spreadsheet.
// Default is 'Sheet1' for new files.
var SHEET_NAME = 'top10';
function doGet(request) {
var callback = request.parameters.jsonp;
@ryoungz
ryoungz / gist:4245661
Last active October 13, 2015 19:37
FizzBuzz in JS
var maxNum = 100;
for (i = 1; i <= maxNum; i++) {
if (i % 15 === 0) {
console.log("FizzBuzz");
} else if (i % 3 === 0){
console.log("Fizz");
} else if (i % 5 === 0) {
console.log("Buzz");
} else {