Skip to content

Instantly share code, notes, and snippets.

View pizzapanther's full-sized avatar
🍕
Crushing it daily

Paul Bailey pizzapanther

🍕
Crushing it daily
View GitHub Profile
@pizzapanther
pizzapanther / weatherkit.py
Created July 4, 2022 20:48
WeatherKit Authorization with JWT
View weatherkit.py
import datetime
# pip install requests PyJWT cryptography
import jwt
import requests
# https://developer.apple.com/account/resources/identifiers/list/serviceId
WEATHERKIT_SERVICE_ID = "" # Create service like (use same ending): com.example.weatherkit-client
# https://developer.apple.com/account/ - click Membership in nav to get Team ID
@pizzapanther
pizzapanther / zulip-notes.md
Last active April 14, 2021 21:34
Fix Zulip Avatars
View zulip-notes.md

Problem

Boto doesn't handle gov cloud S3 urls correctly

Fix

Open file like: sudo nano -iw /home/zulip/deployments/{date}/zulip-py3-venv/lib/python3.6/site-packages/boto/s3/connection.py

Edit Lines:

@pizzapanther
pizzapanther / keybase.md
Created January 31, 2019 01:20
keybase.md
View keybase.md

Keybase proof

I hereby claim:

  • I am pizzapanther on github.
  • I am pizzapanther (https://keybase.io/pizzapanther) on keybase.
  • I have a public key ASAMu8C0le-MQLYkBLBXHBEfUHSgnH_qkuGK9YBaExhQmQo

To claim this, I am signing this object:

@pizzapanther
pizzapanther / .tmux.conf
Created October 12, 2018 22:50
My Tmux Conf
View .tmux.conf
set -g mouse on
@pizzapanther
pizzapanther / bashrc
Last active July 26, 2021 13:57
My Bash Shortcuts
View bashrc
source /usr/share/autojump/autojump.bash
PS1='\W\$ '
eval $(thefuck --alias)
export GOROOT=$HOME/go
export GOPATH=$HOME/go/packages
export GPG_TTY=$(tty)
export EDITOR=/bin/nano
export PATH=$PATH:/home/paulmbailey/bin:/usr/local/go/bin:$GOROOT/bin:./node_modules/.bin
@pizzapanther
pizzapanther / drf-middleware.py
Created October 9, 2018 18:24
Properly auth the Django way with DRF JWT Token
View drf-middleware.py
import jwt
from django.utils.functional import SimpleLazyObject
from django.contrib.auth.middleware import get_user
from django.contrib.auth.models import AnonymousUser
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth import logout as do_logout
EXEMPT = ('/get-jwt', '/refresh-jwt', '/google-tokens', '/refresh-google-token')
@pizzapanther
pizzapanther / canvas-demo.html
Created May 30, 2018 00:17
Canvas Drawing Demoe
View canvas-demo.html
<!DOCTYPE html>
<html>
<head>
<title>Canvas Test</title>
</head>
<body>
<canvas width="400" height="400"></canvas>
<script>
var current;
var past;
@pizzapanther
pizzapanther / express-passport-twitter.js
Last active May 20, 2018 21:19
Passport JS Twitter Starter
View express-passport-twitter.js
const express = require('express');
const nunjucks = require('nunjucks');
const body_parser = require('body-parser');
const session = require('express-session');
var app = express();
nunjucks.configure('views', {
autoescape: true,
express: app,
@pizzapanther
pizzapanther / express-template.js
Created May 19, 2018 17:52
Starter for Express
View express-template.js
// npm install express nunjucks body-parser
const express = require('express');
const nunjucks = require('nunjucks');
const body_parser = require('body-parser');
var app = express();
nunjucks.configure('views', {
autoescape: true,
@pizzapanther
pizzapanther / explain.jsx
Created November 16, 2017 20:37
Explain This Code
View explain.jsx
class MyComponent extends React.Component {
constructor(props) {
// set the default internal state
this.state = {
clicks: 0
};
}
componentDidMount() {
this.refs.myComponentDiv.addEventListener('click', this.clickHandler);