Skip to content

Instantly share code, notes, and snippets.

View jakepruitt's full-sized avatar

Jake Pruitt jakepruitt

View GitHub Profile
@jakepruitt
jakepruitt / recursion.java
Created November 15, 2013 17:46
Code Challenge 11/15/2013
// A utility method that finds the sum of numbers at odd indexes within a sub-
// array starting with startIndex and ending at endIndex
public static int computeSumAtOdd(int[] numbers, int startIndex, int endIndex)
{
if (startIndex == endIndex) // base case: array of size 1, returns number if index odd
{
if (startIndex%2 == 1)
return numbers[startIndex];
else
return 0;
@jakepruitt
jakepruitt / alternatingGrid.js
Last active December 24, 2015 17:09
Alternating rows function Code Challenge
// A function that takes the total number of rows, the total number of columns, oddOrder and evenOrder arrays and an object inputDataObject that contains the arrays to be used as input data.
// The structure of the order arrays must be ["inputData1","inputData2","inputData3"]
function renderAlternatingGrid (totalRowNumber, totalColumnNumber, oddOrder, evenOrder, inputDataObject) {
var alternatingGrid = [];
for (var rowIndex = 0; rowIndex < totalRowNumber; rowIndex++) {
alternatingGrid[rowIndex] = [];
function orderRowElements (order) {
for (var columnIndex = 0; columnIndex < totalColumnNumber; columnIndex++) {
var dataKey = order[columnIndex];
@jakepruitt
jakepruitt / using-classes.css
Created September 27, 2013 21:02
The use of id's and classes for DOM speed
/* -------------- Customer Success Stories - Sub-Layouts ----------------------- */
div.success_section { padding:0 0 20px 0; margin:0 0 20px 0; border-bottom:1px solid #dfdfdf; }
div.success_section:last-child { border:none; }
div.success_section h2 { margin:0 0 40px 0; }
div.success_section a.all_products_link { display:block; margin:25px 0; font-size:14px; color:#ee3124; font-weight:bold; }
div.success_section a.view_all { clear:both; float:right; font-size:11px; text-align:right; color:#3b87de; }
div.success_block div.pic { margin:0 10px 20px 0; width:210px; float:left; }
@jakepruitt
jakepruitt / business-aviation.html
Created September 27, 2013 20:55
A quick gist for a code demo
<div id="ctl11_ctl00_MainNavRepeater_ctl01_SubMenuPanel" class="subnav">
<ul class="clearfix" style="text-align: left;">
<li style="margin-left: 101px;"><a href="/business-aviation/featured-products">Featured Products</a></li>
<li ><a href="/business-aviation/platforms">Platforms</a></li>
<li ><a href="/business-aviation/transform-your-aircraft">Transform Your Aircraft</a></li>
@jakepruitt
jakepruitt / BlogAndFeaturedSL.html
Created September 27, 2013 19:42
Business Aviation Featured Image Carousel
<div class="featured cycle-slideshow" data-cycle-slides=".slide" data-cycle-pause-on-hover="true" data-cycle-timeout=7000 data-cycle-fx="scrollHorz">
<ul class="slide popup-gallery clearfix">
<li class="title"><h3>Transforming Business Aircraft</h3></li>
<li><a href="/assets/images/gallery-big-image-1.jpg" style="background: url('/assets/images/gallery-image-1.jpg')"><h5>View Image</h5></a></li>
<li><a href="/assets/images/gallery-big-image-2.jpg" style="background: url('/assets/images/gallery-image-2.jpg')"><h5>View Image</h5></a></li>
<li><a href="/assets/images/gallery-big-image-3.jpg" style="background: url('/assets/images/gallery-image-3.jpg')"><h5>View Image</h5></a></li>
<li><a href="/assets/images/gallery-big-image-4.jpg" style="background: url('/assets/images/gallery-image-4.jpg')"><h5>View Image</h5></a></li>
<li><a href="/assets/images/gallery-big-image-5.jpg" style="background: url('/assets/images/gallery-image-5.jpg')"><h5>View Image</h5></a></l
@jakepruitt
jakepruitt / business-aviation-support.html
Last active December 24, 2015 02:49
Business Aviation Support Contact Pulling
<div class="support_form">
<h4>Who would you like to contact?</h4>
<div class="looking_for">
<label>I’m looking for:</label>
<select id="contact_type">
<option>Select Contact Type</option>
<option>Area Sales Managers</option>
<option>Customer Support Managers</option>
<option>Dealer &amp; Service Center</option>
@jakepruitt
jakepruitt / code-challenge-7-26
Last active December 20, 2015 07:09
Code Challenge 7/26, count and sort a sample sentence.
var meSentence = "This is a test sentence and it is not the sentence we will ultimately test with";
// Create array
var meIndex = meSentence.replace(/[.,;'"]/, "").toLowerCase().split(" ");
// Instantiate object
var me = {};
// Tally wordcount
for (var i = 0; i < meIndex.length; i++) {
me[meIndex[i]] = 1;
for (var j = 0; j < i; j++) {
if (meIndex[i] == meIndex[j]) {