Skip to content

Instantly share code, notes, and snippets.

View mrpbennett's full-sized avatar
🏠
Working from home

Paul Bennett mrpbennett

🏠
Working from home
View GitHub Profile
@mrpbennett
mrpbennett / noneea_rawrequest.json
Created January 4, 2024 13:09
pulsepoint_rawrequest
{
"id": "d4335929-018c-1000-c055-fd2817650034",
"imp": [
{
"id": "1",
"banner": {
"format": [
{
"w": 320,
"h": 50
@mrpbennett
mrpbennett / pinned_repos.js
Last active January 21, 2022 17:57
Pinned Repos - GraphQL
const Projects = () => {
const data = useStaticQuery(graphql`
query MyQuery {
githubData {
data {
repositoryOwner {
pinnedItems {
edges {
node {
name
@mrpbennett
mrpbennett / requests.py
Created January 21, 2022 08:51
Ideal way to use requests
import requests
url = '...'
try:
r = requests.get(url)
r.raise_for_status()
if r.status_code == requests.codes.ok:
# Do something...
@mrpbennett
mrpbennett / strava.py
Last active March 28, 2023 07:36
Get auth token for Strava - python
def get_strava_token() -> str:
""" generates Strava Auth token and returns it """
auth_url = "https://www.strava.com/oauth/token"
payload = {
"client_id": "xxxx",
"client_secret": "xxxx",
"refresh_token": "xxxx",
"grant_type": "refresh_token",
"f": "json",
@mrpbennett
mrpbennett / dockerfile
Last active February 2, 2022 09:49
Flask Docker file
# For more information, please refer to https://aka.ms/vscode-docker-python
FROM python:3.8-slim-buster
EXPOSE 5000
ENV VAR1=10
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
@mrpbennett
mrpbennett / amazon-display.html
Last active February 16, 2021 19:59
APS Basic Integration
<!-- GPT -->
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function () {
googletag
.defineSlot(
"/116082170/Cottam_Test_UAM_300x250",
[[300, 250]],