This file contains 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 findRow(searchVal) { | |
// find row containing the event's timestamp | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var data = sheet.getDataRange().getValues(); | |
var searchDate = new Date(searchVal); | |
for (x = 0; x < data.length; x++) { | |
var thisDate = new Date(data[x][0]); | |
if (thisDate.getTime() === searchDate.getTime()) { | |
return x + 1; | |
} |
This file contains 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
const calendarId = "ENTER_CALENDAR_ID"; | |
const uniqueEventSuffix = "[MOONCAL]"; | |
const dataRange = "A2:C"; | |
function deleteAutoCreatedEvents() { | |
var eventCal = CalendarApp.getCalendarById(calendarId); | |
var startOfCurrentYear = new Date(new Date().getFullYear(), 0, 1); | |
var endOfCurrentYear = new Date(new Date().getFullYear(), 11, 31) | |
var events = eventCal.getEvents(startOfCurrentYear, endOfCurrentYear); | |
for(var i=0; i < events.length; i++) { |
This file contains 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
// | |
// 1. Go to https://www.strava.com/athlete/training | |
// | |
// 2. Open the Chrome developer console | |
// | |
// 3. Paste into the console the code from | |
// https://github.com/eligrey/FileSaver.js/blob/master/src/FileSaver.js | |
// | |
// 4. Paste the two functions below into the console | |
// |
This file contains 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
{% if (hero) %} | |
<img class="page-hero" src="{{ hero }}" alt="Hero image for {{ title }}" /> | |
{% endif %} |
This file contains 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
<table> | |
<thead> | |
<tr> | |
<th>Date</th> | |
<th>Title</th> | |
<th>Location</th> | |
</tr> | |
</thead> | |
<tbody> | |
{%- for post in collections.events -%} |
This file contains 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 ); | |
}) | |
); |
This file contains 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 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 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 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, |
NewerOlder