Skip to content

Instantly share code, notes, and snippets.

View trnl's full-sized avatar

Vova Mihura trnl

View GitHub Profile
import requests as http
import pandas as pd
headers = { "Authorization": "Bearer gAAAA...."}
athlete_id = "....."
start_date = "2022-12-01"
end_date = "2023-07-01"
workouts = http.get(f"https://tpapi.trainingpeaks.com/fitness/v6/athletes/{athlete_id}/workouts/{start_date}/{end_date}", headers=headers).json()
@trnl
trnl / server.py
Created February 3, 2021 12:10
Echo Server
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@trnl
trnl / versioner.sh
Last active March 3, 2020 09:31
Versioner
#!/bin/bash
pip install --user gitpython==2.1.8 jira==1.0.10
cat << EOF > script.py
import git
import re
import itertools
import os
from datetime import datetime, date, timedelta
@trnl
trnl / _.py
Last active August 29, 2015 14:12
TV Guide with matplotlib
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from datetime import datetime
from pandas import DataFrame
from matplotlib.ticker import FuncFormatter, MultipleLocator
from matplotlib.cm import ScalarMappable
from matplotlib.transforms import TransformedBbox, Bbox
# load dataframe
package org.jenkinsci.plugins.twitter;
import hudson.Extension;
import hudson.Launcher;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.model.Descriptor;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.Builder;
@trnl
trnl / gist:4562257
Created January 18, 2013 04:04
Create default folders tree in Gradle project
task "create-dirs" << {
sourceSets.all{
it.allSource.srcDirs*.mkdirs()
}
}
@trnl
trnl / gist:3777863
Created September 24, 2012 19:33
Заповедь | Редьярд Киплинг
Заповедь
Владей собой среди толпы смятенной,
Тебя клянущей за смятенье всех,
Верь сам в себя наперекор вселенной,
И маловерным отпусти их грех;
Пусть час не пробил, жди, не уставая,
Пусть лгут лжецы, не снисходи до них;
Умей прощать и не кажись, прощая,
Великодушней и мудрей других.
@trnl
trnl / 10_TwitterNotifier.java
Created August 31, 2012 01:50
Jenkins Training: Day 2 Part 2
package org.jenkinsci.plugins;
import hudson.Extension;
import hudson.Launcher;
import hudson.model.AbstractBuild;
import hudson.model.AbstractProject;
import hudson.model.BuildListener;
import hudson.tasks.BuildStepDescriptor;
import hudson.tasks.BuildStepMonitor;
import hudson.tasks.Notifier;
@trnl
trnl / 1_settings.xml
Created August 30, 2012 14:36
Jenkins Training: Day 2 Part 1
<settings>
<pluginGroups>
<pluginGroup>org.jenkins-ci.tools</pluginGroup>
</pluginGroups>
<profiles>
<!-- Give access to Jenkins plugins -->
<profile>
<id>jenkins</id>
<activation>
<activeByDefault>true</activeByDefault>