Skip to content

Instantly share code, notes, and snippets.

View chrislpatton's full-sized avatar

Christopher Patton chrislpatton

  • Greater Atlanta Area
View GitHub Profile
@chrislpatton
chrislpatton / isEven.js
Created June 22, 2016 02:22
Using JavaScript, given an array of n integers (example: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 112, 113] ), remove all odd numbers, leaving only the even numbers. Rules: NO LOOPING. This means native methods, or libraries that loop for you are not allowed either.
var nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 112, 113] ;
function onlyEvens(arr, index) {
if (index === undefined) {
index = 0;
return onlyEvens(arr,index);
}
if (index === arr.length){
return arr;
@chrislpatton
chrislpatton / index.html
Created July 11, 2016 13:24
Table Challenge
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bank of America Customer Table</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<style>
body {
font-style: normal;
var input, current, index;
var _OPERATOR = 1;
var _NUMBER = 2;
var _EOF = 3;
function next() {
var char, token = {};
while(index < input.length) {
@chrislpatton
chrislpatton / addon.js
Created May 31, 2018 11:58
Minimum order amount
<!-- Minimum order amount -->
<script>
var orderAmount = 30;
</script>
<script src="/content/custom-addon.js"></script>
<!-- Minimum order amount -->
// minimum order amount
//var orderAmount = 30;
@chrislpatton
chrislpatton / nvmCommands.js
Created August 20, 2018 15:49 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list installed versions of node (via nvm)
nvm ls
// install specific version of node
nvm install 6.9.2
// set default version of node
<!--IS+-->
<script src="https://code.jquery.com/jquery-1.9.1.js"></script>
<script async src="//acp-magento.appspot.com/js/acp-magento.js?v=3&mode=bigcommerce&UUID=3cc6d87b-b66a-490f-b3e7-a09d36286a60&store=1"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="https://chimpstatic.com/mcjs-connected/js/users/a1a8fbc578788bfcccc13c39c/0afa28ea9a844933d83ecf116.js"></script>
<!--IS+-->
<!-- Twitter universal website tag code -->
<meta name="google-site-verification" content="nozy74bN8-K65HpQcyEZ7cKESqxNeuLtQoVo_m42tNM" />
<script type='text/javascript'>
window._tfa = window._tfa || [];
window._tfa.push({notify: 'event', name: 'page_view'});
!function (t, f, a, x) {