Skip to content

Instantly share code, notes, and snippets.

View akrug23's full-sized avatar

Aaron Krug akrug23

View GitHub Profile
@akrug23
akrug23 / css
Created November 3, 2016 13:44
Vertical Alignment Center fuild using transform to center text
.container {
position: relative;
min-height: 100vh;
}
.vertical-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
@akrug23
akrug23 / css
Created November 3, 2016 13:35
Vertical Alignment Center fuild
.container:before {
content: "";
display: inline-block;
height: 100%;
vertical-align: middle;
}
.box {
width:50%;
display: inline-block;
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
@akrug23
akrug23 / scrollTo.js
Created August 14, 2016 19:52
Scroll to element
$("#button").click(function() {
$('html, body').animate({
scrollTop: $("#elementtoScrollToID").offset().top
}, 2000);
});
@akrug23
akrug23 / calendar.scss
Created July 11, 2016 13:49
Calendar Thumbnail
.calendar
{
display: table;
width: 78px;
height: 80px;
text-align: center;
border-radius: 14px;
@akrug23
akrug23 / carousel-fade.scss
Created July 11, 2016 13:37
Make Bootstrap carousel fade instead of slide
@akrug23
akrug23 / php
Last active October 22, 2018 17:44
US 50 States (PHP & HTML)
$state_names = array(
"AL" => "Alabama",
"AK" => "Alaska",
"AZ" => "Arizona",
"AR" => "Arkansas",
"CA" => "California",
"CO" => "Colorado",
"CT" => "Connecticut",
"DE" => "Delaware",
"DC" => "District of Columbia",
@akrug23
akrug23 / mapInital.js
Created November 20, 2015 16:39
Google Maps v3 API Center on Multiple Markers
<script>
/*
* Google Maps: Zoom-to-Fit Markers (v3)
* http://salman-w.blogspot.com/2011/03/zoom-to-fit-all-markers-on-google-map.html
*/
function map_initialize() {
var cwc2011_venue_data = [
{
name: "Eden Gardens, India",
latlng: new google.maps.LatLng(22.564444, 88.343333)
@akrug23
akrug23 / html
Created September 20, 2013 00:04
US States Dropdown
<form action="./" method="GET">
<select name="state">
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>