Skip to content

Instantly share code, notes, and snippets.

View zacwasielewski's full-sized avatar

Zac Wasielewski zacwasielewski

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<title>One Minute Map</title>
<meta charset="utf-8">
<link rel="stylesheet" href="https://www.nextzen.org/js/nextzen.css">
<script src="https://www.nextzen.org/js/nextzen.min.js"></script>
<style>
#map {
height: 100%;
@zacwasielewski
zacwasielewski / gimme_pizza.rb
Last active September 28, 2020 15:51
Rendezvous with cassidoo question of the week – September 28th, 2020
# Given an array of people objects (where each person has a name and a number of pizza slices they’re hungry for) and a number for the number of slices that the pizza can be sliced into, return the number of pizzas you need to buy.
#
# Example:
#
# $ arr = [{ name: Joe, num: 9 }, { name: Cami, num: 3 }, { name: Cassidy, num: 4 }]
# $ gimmePizza(arr, 8)
# $ 2 // 16 slices needed, pizzas can be sliced into 8 pieces, so 2 pizzas should be ordered
def gimmePizza(people, slices_per_pizza)
slices = people.map{|o| o.fetch(:num)}.sum
@zacwasielewski
zacwasielewski / move_zeros.rb
Last active August 18, 2020 01:16
Rendezvous with cassidoo question of the week – August 27th, 2020
# Given an array of random integers, move all the zeros in the array
# to the end of the array. Try to keep this in O(n) time (or better)!
#
# Example:
#
# $ moveZeros([1, 2, 0, 1, 0, 0, 3, 6])
# $ [1, 2, 1, 3, 6, 0, 0, 0]
# This is prettier! :)
def moveZeros(nums)
@zacwasielewski
zacwasielewski / kitchen-package-deals.html
Last active January 31, 2018 17:34
Kitchen Package Deals changes
<!--
Various minor spacing adjustments
-->
<img class="img-responsive wp-image-2500 aligncenter" src="http://jayklumber.staging.wpengine.com/wp-content/uploads/2018/01/LP_HeaderImage-600x152.jpg" alt="" width="699" height="177" />
<h2 class="p1"><span class="s1">Design your new kitchen with our experts</span></h2>
<div class="row">
<div class="col-lg-7">
<p>If you’ve been waiting to start your kitchen remodel, these package deals make this the perfect time to get started!</p>
@zacwasielewski
zacwasielewski / secretArchivesLock.js
Last active July 11, 2017 13:22
Solution to CodeFights `secretArchivesLock` challenge
const secretArchivesLock = (lock, actions) =>
optimizeActions([...actions]).reduce((lock, direction) => move(lock, direction), lock)
const move = (lock, direction) => {
return {
'L': moveLeft(lock),
'R': moveRight(lock),
'U': moveUp(lock),
'D': moveDown(lock)
}[direction] || lock
@zacwasielewski
zacwasielewski / index.ios.js
Last active March 3, 2017 20:12
Maintaining state across multiple React Navigation StackNavigator screens with this.props.screenProps (probably the wrong way to do this!)
import React, { Component } from 'react'
import {
AppRegistry,
Button,
Text,
TextInput,
View,
} from 'react-native'
import { StackNavigator } from 'react-navigation'
import validator from 'email-validator'
var NOTIFY_RULES = {
'South Utica': 'eriley@romanelli.com, zac@romanelli.com',
'New Hartford': ''
};
var NOTIFY_CONDITION = 'Most convenient branch for us to meet';
var NOTIFY_URL = 'https://zapier.com/hooks/catch/3c89f1/';
//var NOTIFY_URL = 'http://requestb.in/1hjdom11'; // TEST
var payload = {};
for (var prop in input) {
{% comment %}
Responsive product images with srcset.
{% endcomment %}
{% assign default_default_size = "medium" %}
{% assign default_sizes = "100vw" %}
{% assign default_image = product.featured_image %}
{% if default_size == nil %}{% assign default_size = default_default_size %}{% endif %}
{% if sizes == nil %}{% assign sizes = default_sizes %}{% endif %}
@zacwasielewski
zacwasielewski / first-source-chamber-expo-ipad.css
Created August 25, 2015 16:02
First Source Chamber Expo Wufoo CSS
html,
body {
margin: 0;
background-color: transparent;
}
#container {
width: auto;
box-shadow: none;
border: none;
@zacwasielewski
zacwasielewski / custom-underline.scss
Created July 17, 2015 02:27
SCSS mixin for perfect text underlines
// Adapted from the super-awesome technique described here:
// http://www.acusti.ca/blog/2014/11/28/towards-a-more-perfect-link-underline/
@mixin custom-underline($color, $underline-color, $hover-color, $hover-underline-color, $bg-color) {
color: $color;
text-decoration: none;
// Underline via gradient background
background-image: linear-gradient($underline-color 0%, $underline-color 100%);
background-repeat: repeat-x;
background-size: 1px 1px;