Skip to content

Instantly share code, notes, and snippets.

View adamgiese's full-sized avatar

Adam Giese adamgiese

View GitHub Profile
@adamgiese
adamgiese / sum-reducer.js
Created July 17, 2018 12:59
Declarative Arrays: Sum reducer
const numbers = [1,2,3,4,5];
const sum = numbers.reduce(
(accumulator, currentValue) => accumulator + currentValue
);
console.log(sum); // 15
@adamgiese
adamgiese / imperative-cart-total.js
Last active July 15, 2018 20:23
Array Manipulation: Imperative Cart Total
var total = 0;
for (let index = 0; index < shoppingCart.length; index++) {
let currentItem = shoppingCart[index];
total = total + currentItem.price * currentItem.quantity;
}
@adamgiese
adamgiese / shopping-cart.js
Last active July 15, 2018 20:10
Array Manipulation: Shopping Cart
const shoppingCart = [
{
name: 'Diet Coke',
price: 1.50,
quantity: 3,
},
{
name: 'Dasani',
price: 1,
quantity: 2,
(function() {
const stats = {
wins: 0,
losses: 0,
};
const times = x => f => {
if (x > 0) {
f()
@adamgiese
adamgiese / brainstorm.md
Created November 19, 2017 16:14
General Brainstorming

Hello World

@adamgiese
adamgiese / resume.json
Last active May 28, 2017 16:07
My Resume, in JSON form
{
"info": {
"name": "Adam Giese",
"summary": "With seven years of Web Developer experience, I have been focusing on front-end and WordPress development for the last three years."
},
"experience": [
{
"employer": "Intelechy Group",
"title": "Senior Web Developer",
"from": "October 2014",
{
"hello": "world",
"hola": "mundo",
"howdy": "texas"
}
@adamgiese
adamgiese / nth-child-quantity-mixins.scss
Last active April 19, 2023 11:22
Advanced nth-child mixins
@mixin valid-quantity($quantity) {
@if type-of($quantity) != 'number' {
@error 'The "quantity" parameter must be a number!';
}
@if not(unitless($quantity)) {
@error 'The "quantity" parameter must not have a unit!';
}
@if $quantity < 0 {
@error 'The "quantity" parameter must be at least 0!';
}
@adamgiese
adamgiese / FizzBuzz
Last active August 29, 2015 14:05
JavaScript FizzBuzz Example
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>FizzBuzz</title>
</head>
<body>
<div id="Fizzy-Buzz">
</div>