This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Template Name: Gallery */ | |
/** | |
* The Template for displaying gallery cake images. | |
* @package Motif | |
*/ | |
get_header(); ?> | |
<?php | |
// use a nonce: a one-time token to identify future requests to the web site |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action("wp_enqueue_scripts", "my_enqueue", 11); | |
function my_enqueue() { | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js", false, null); | |
wp_enqueue_script('jquery'); | |
wp_enqueue_script( 'function', get_stylesheet_directory_uri().'/js/gallery_script.js', 'jquery', true); | |
} | |
// add actions to respond to get_gallery_data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function renderGrid(gallery) { | |
// helper function to loop through all gallery items and output HTML | |
var cell = ""; | |
for (var i = 0; i < gallery.length; i++) { | |
cell += "<li>"; | |
cell += " <img src='/images/" + gallery[i].id + ".jpg' />"; | |
cell += " <b>" + gallery[i].size + "</b>" + gallery[i].occasion; | |
cell += "</li>"; | |
// append this cake to the gallery |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on("click", function() { | |
$(".js-done-button:visible").closest(".row").hide(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(plotKML) | |
# Find GPX files using a pattern | |
files <- dir(pattern = "\\.gpx") | |
# Consolidate routes in one drata frame | |
index <- c() | |
latitude <- c() | |
longitude <- c() | |
for (i in 1:length(files)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async componentDidMount() { | |
// trigger data load from openskimap | |
axios | |
.get(`//tiles.skimap.org/geojson/ski_areas.geojson`) | |
.then((res) => { | |
const resorts = | |
res.data.features.map((resort) => ({ | |
id: resort.properties.id, | |
point: getPointForResort(resort), | |
name: resort.properties.name, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class SkiMap extends Component { | |
state = defaultMapState; | |
render() { | |
return this.props.resorts ? ( | |
<Map | |
center={[this.state.lat, this.state.lng]} | |
zoom={this.state.zoom} | |
style={{ width: "100%", position: "absolute", top: 0, bottom: 0, zIndex: 500, }} | |
updateWhenZooming={false} | |
updateWhenIdle={true} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var maxPage = 25; // calculate this using (activities/20 + 1) | |
var activityType = "Run"; // change to the workout type you want, or blank for all | |
var p = 1; | |
var done = 0; | |
var url; | |
var nw = window.open("workouts.html"); | |
nw.document.write("["); | |
while (p <= maxPage) { | |
url = "https://www.strava.com/athlete/training_activities" + | |
"?keywords=&activity_type=" + activityType + "&workout_type=&commute=&private_activities=" + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"pic": { | |
"prefix": "pic", | |
"body": "{% picture \"/images/.jpg\", \"Caption\" %}" | |
}, | |
"picrt": { | |
"prefix": "picrt", | |
"body": "{% pictureRt \"/images/.jpg\", \"Caption\" %}" | |
}, | |
"lb": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eleventyConfig.addCollection("events", (collection) => | |
collection.getFilteredByGlob("posts/*.md").filter( post => { | |
return ( item.data.location ? post : false ); | |
}) | |
); |
OlderNewer