Skip to content

Instantly share code, notes, and snippets.

View PetteriVaarala's full-sized avatar

Petteri Vaarala PetteriVaarala

View GitHub Profile
@PetteriVaarala
PetteriVaarala / sports-tracker-download.js
Created September 7, 2021 16:58 — forked from KonstantinosSykas/sports-tracker-download.js
Download all workouts from sports-tracker
// based entirely on this blog post:
// http://druss.co/2016/04/export-all-workouts-from-sports-tracker/
// unfortunately the original script no longer works, moslty because jQuery is
// no longer available on sports-tracker pages.
//
// I've compiled the changes proposed in the comments in the script below.
// to use the script, login to your sports-tracker account
// change URL to http://www.sports-tracker.com/diary/workout-list
// open browser console (Cmd-Shift-I)
#!/bin/bash
# Prevent commit to protected branches
PROTECTED_BRANCHES=("protected" "master")
CURRENT_BRANCH=$(basename "$(git symbolic-ref HEAD)")
for PROTECTED_BRANCH in "${PROTECTED_BRANCHES[@]}";do
# Split current branch
if [ "${CURRENT_BRANCH##*/}" == "${PROTECTED_BRANCH}" ];then
read -p "Commit to master, are you sure? (Y|n) " -n 1 -r < /dev/tty
@PetteriVaarala
PetteriVaarala / mongod.log
Created December 4, 2012 10:13
Uptime / MongoDB problem
Tue Dec 4 12:05:43 [initandlisten] connection accepted from 127.0.0.1:45369 #51 (1 connection now open)
Tue Dec 4 12:05:43 [initandlisten] connection accepted from 127.0.0.1:45371 #52 (2 connections now open)
Tue Dec 4 12:05:43 [initandlisten] connection accepted from 127.0.0.1:45372 #53 (3 connections now open)
Tue Dec 4 12:05:43 [initandlisten] connection accepted from 127.0.0.1:45373 #54 (4 connections now open)
Tue Dec 4 12:05:43 [initandlisten] connection accepted from 127.0.0.1:45374 #55 (5 connections now open)
Tue Dec 4 12:05:43 [conn55] authenticate db: uptime { authenticate: 1, user: "pvaarala", nonce: "b424606c32382c5e", key: "270a70f461f44d058aa8c98db7320d4f" }
Tue Dec 4 12:05:43 [conn54] authenticate db: uptime { authenticate: 1, user: "pvaarala", nonce: "d81d75ce7a918890", key: "8d3900d00414592b911d07817a54433b" }
Tue Dec 4 12:05:43 [conn53] authenticate db: uptime { authenticate: 1, user: "pvaarala", nonce: "7e0c3ef44389e73a", key: "cb140b9953bba755d41794e17f7a5572" }
Tue Dec 4 12:0
@PetteriVaarala
PetteriVaarala / tilemill-packages.txt
Created October 9, 2012 23:27
Tilemill 10.0 crash (Natty)
Package: tilemill
New: yes
State: installed
Automatically installed: no
Version: 0.10.0~natty1
Priority: extra
Section: web
Maintainer: Ian Ward <ian@developmentseed.org>
Uncompressed Size: 142 M
Depends: libatk1.0-0 (>= 1.12.4), libc6 (>= 2.7), libcairo2 (>= 1.2.4), libfontconfig1
@PetteriVaarala
PetteriVaarala / index.php
Created August 16, 2012 17:12
Twig example
<?php
require_once 'Twig/lib/Twig/Autoloader.php';
Twig_Autoloader::register();
$loader = new Twig_Loader_Filesystem('views');
$twig = new Twig_Environment($loader);
$navigation = array(
array('title' => 'Quake',
@PetteriVaarala
PetteriVaarala / bash
Created January 28, 2012 13:55
Osmosis error
Osmosis
Jan 28, 2012 2:07:36 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Osmosis Version 0.40.1
Jan 28, 2012 2:07:37 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Preparing pipeline.
Jan 28, 2012 2:07:37 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Launching pipeline execution.
Jan 28, 2012 2:07:37 PM org.openstreetmap.osmosis.core.Osmosis run
INFO: Pipeline executing, waiting for completion.
#
@PetteriVaarala
PetteriVaarala / index.html
Created November 19, 2011 17:46
OpenLayers & KML Highlight
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>KML highlight</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body onload="init();">
<div id="map"></div>