Skip to content

Instantly share code, notes, and snippets.

View SpencerCooley's full-sized avatar

Spencer Cooley SpencerCooley

View GitHub Profile
$.each(month, function(index, value){
$( "#"+ value +"_"+type ).slider({
orientation: "horizontal",
range: "min",
min: 0,
max: 100,
value: 8.33,
slide: function( event, ui ) {
var total = parseInt($('.'+type+'_jan_slider_position').html()) + parseInt($('.'+type+'_feb_slider_position').html()) + parseInt($('.'+type+'_mar_slider_position').html()) + parseInt($('.'+type+'_apr_slider_position').html()) + parseInt($('.'+type+'_may_slider_position').html()) + parseInt($('.'+type+'_jun_slider_position').html()) + parseInt($('.'+type+'_jul_slider_position').html()) + parseInt($('.'+type+'_aug_slider_position').html()) + parseInt($('.'+type+'_sep_slider_position').html()) + parseInt($('.'+type+'_oct_slider_position').html()) + parseInt($('.'+type+'_nov_slider_position').html()) + parseInt($('.'+type+'_dec_slider_position').html())
@media only screen and (max-width: 1280px) and (min-width: 768px) {
.touch table.hide-on-phones { display: table !important; }
.touch table.hide-on-desktops { display: table !important; }
.touch table.show-on-tablets { display: table !important; }
body.home #header-logo {
width:auto;
position:absolute;
top:25px;
left:-15px;
//point in polygon algorithm
var inside = function (point, polygon) {
// ray-casting algorithm based on
// http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
var x = point[0], y = point[1];
var inside = false;
for (var i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
var xi = polygon[i][0], yi = polygon[i][1];
//point in polygon algorithm
var pointInPolygon = function (point, polygon) {
// ray-casting algorithm based on
// http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html
var x = point[0], y = point[1];
var inside = false;
for (var i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
var xi = polygon[i][0], yi = polygon[i][1];
move this out of .thumbnails and put it in .sidebar right above .comments
<div class="thumbnail_highlight" ></div>
replace with this
.thumbnail_highlight{
width:100px;
height:90px;
background:#F1ECDF;
position:absolute;
right:0px;
var geocoder = new google.maps.Geocoder();
$("#address").autocomplete({
//This bit uses the geocoder to fetch address values
source: function(request, response) {
geocoder.geocode( {'address': request.term }, function(results, status) {
response($.map(results, function(item) {
return {
label: item.formatted_address,
value: item.formatted_address,
@SpencerCooley
SpencerCooley / gist:3587674
Created September 1, 2012 21:18
Kegerator Instructions
var instructions = function(){
if (Beer.length && Person.age() >= 21 ){
Beer.drink();
}
else{
console.log("Get Outta here");
}
}
@SpencerCooley
SpencerCooley / gist:3473638
Created August 26, 2012 03:36
changes to custom-css.php
/* the_padding_change padding changes on navigation menu */
#menu_wrapper .nav ul li a, #menu_wrapper div .nav li a {padding-right:<?php echo get_option('padding_menu_full_width'); ?>px; padding-left:<?php echo get_option('padding_menu_full_width'); ?>px; color: <?php echo $pp_menu_link_color; ?>; }
<?php
}
?>
@SpencerCooley
SpencerCooley / gist:3473564
Created August 26, 2012 03:28
add a settings section to a wordpress theme.
<?php
/* This is the custom extra theme option panel.*/
//Custom Theme Settings
add_action('admin_menu', 'add_gcf_interface');
function add_gcf_interface() {
add_options_page('Extra Theme Settings', 'Extra Theme Settings', '8', 'functions', 'editglobalcustomfields');
}
function editglobalcustomfields() {
<!--SLIDER GOES HERE-->
<div class="slider-wrapper theme-default" style="width:980px;margin:0 auto;">
<div id="slider" class="nivoSlider theme-default">
<%= image_tag("pics/feature.png", id: "feature-screenshot", alt: "screenshot") %>
<%= image_tag("pics/feature.png", id: "feature-screenshot", alt: "screenshot") %>
<%= image_tag("pics/feature.png", id: "feature-screenshot", alt: "screenshot") %>
<%= image_tag("pics/feature.png", id: "feature-screenshot", alt: "screenshot") %>
</div>
</div>