Skip to content

Instantly share code, notes, and snippets.

@musicalbigfoot
musicalbigfoot / montana-zip-counties
Last active May 22, 2019 20:46
Array of Montana Zip Code => County (updated 05/2019)
$montana_zip_counties = [
"59001" => "Stillwater",
"59002" => "Yellowstone",
"59003" => "Rosebud",
"59004" => "Rosebud",
"59006" => "Yellowstone",
"59007" => "Carbon",
"59008" => "Carbon",
"59010" => "Treasure",
"59011" => "Sweet Grass",
@musicalbigfoot
musicalbigfoot / javascript-debounce
Created October 12, 2016 15:35
javascript debounce
function debounce(func, wait, immediate?) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
@musicalbigfoot
musicalbigfoot / gist:bbabae80cefc8d0ae9e8
Created April 9, 2015 04:06
ACF: Update repeater field sort order jquery/ajax
$('#my-library').sortable({
// containment: "parent",
items: "> li.set-item",
update: function(e, ui){
console.log('UPDATE');
var new_order = $(this).sortable('toArray');
updateSortOrder(new_order);
}
});
@musicalbigfoot
musicalbigfoot / gist:8480681
Created January 17, 2014 20:20
CSS: Vertically Centered
.vertical-centered {
position: relative;
top: 50%;
transform: translateY(-50%)
}
@musicalbigfoot
musicalbigfoot / gist:8469434
Created January 17, 2014 06:49
CSS: Animation
@-webkit-keyframes animationname {
0% { opacity: 0; }
50% { opacity: 1; }
100% { opacity: 0; }
}
@-moz-keyframes animationname {
0% { opacity: 0; }
50% { opacity: 1; }
100% { opacity: 0; }
}
@musicalbigfoot
musicalbigfoot / gist:8469276
Created January 17, 2014 06:28
CSS: background-size: cover
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
@musicalbigfoot
musicalbigfoot / gist:8469049
Created January 17, 2014 05:59
CSS: Transition (short)
-webkit-transition: all .5s ease-in-out;
-ms-transition: all .5s ease-in-out;
transition: all .5s ease-in-out;
@musicalbigfoot
musicalbigfoot / gist:8215903
Created January 2, 2014 07:07
CSS: :after clear
:after {
content: "";
display: block;
clear: both;
}
@musicalbigfoot
musicalbigfoot / gist:8215899
Created January 2, 2014 07:07
css: clear :before
:before {
content: "";
display: block;
clear: both;
}
$loggedin_user = Auth::instance()->get_user();