Skip to content

Instantly share code, notes, and snippets.

@jrjames83
jrjames83 / garmin.gpx
Created May 14, 2017 23:35
garmin data
<?xml version="1.0" encoding="UTF-8"?>
<gpx creator="Garmin Connect" version="1.1"
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/11.xsd"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:ns3="http://www.garmin.com/xmlschemas/TrackPointExtension/v1"
xmlns:ns2="http://www.garmin.com/xmlschemas/GpxExtensions/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata>
<link href="connect.garmin.com">
<text>Garmin Connect</text>
</link>
@rvanzon
rvanzon / nuxt.config.js
Last active September 1, 2022 13:25
A way to use vue-chartjs as a plugin of Nuxt.js
// just an example. A cleaner way is to wrap the showLine-stuff in a dedicated component
<template>
<div>
<my-line v-if="showLine" :data="lineData" :options="options">
</div>
</template>
<script>
export default {
data () {
@olliefr
olliefr / gdmpydemo.py
Created April 4, 2017 00:11
Google Distance Matrix API Python client example
# Google Distance Matrix Python Demo
# ==================================
#
# How to set up (Local part)
# --------------------------
#
# Must have Python (>= 3.4) installed with 'requests' library. On Windows, maybe try
# Anaconda Python? It has a 'conda' package manager, make sure 'requests' is installed.
#
# How to set up (Internet part)
@dimi-tree
dimi-tree / 01_models.py
Last active November 17, 2020 07:16
Django REST Framework: understaning ModelSerializer
from django.db import models
class Member(models.Model):
# RE: null vs blank
#
# NULL https://docs.djangoproject.com/en/1.10/ref/models/fields/#null
# Avoid using null on string-based fields such as CharField and TextField because
# empty string values will always be stored as empty strings, not as NULL.
#
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@gyng
gyng / instructions
Created September 15, 2014 06:23
MarineTraffic scraper
Install Ruby
gem install nokogiri
gem install sqlite3
To open the db from command line: sqlite3 mydb.db
@alexanderjulo
alexanderjulo / celery-crontab.py
Created June 29, 2012 15:16
celery crontab example
from celery.schedules import crontab
from flask.ext.celery import Celery
CELERYBEAT_SCHEDULE = {
# executes every night at 4:15
'every-night': {
'task': 'user.checkaccounts',
'schedule': crontab(hour=4, minute=20)
}
}
#!/usr/bin/env python
"""
Proof of concept scraper for pinnacle sports