Skip to content

Instantly share code, notes, and snippets.

Avatar

Brenton Cleeland sesh

View GitHub Profile
@sesh
sesh / headers.txt
Created Dec 6, 2021
List of unique header keys
View headers.txt
accept-ch
accept-ch-lifetime
accept-encoding
accept-ranges
access-control-allow-credentials
access-control-allow-everything
access-control-allow-headers
access-control-allow-methods
access-control-allow-origin
access-control-expose-headers
View keybase.md

Keybase proof

I hereby claim:

  • I am sesh on github.
  • I am sesh (https://keybase.io/sesh) on keybase.
  • I have a public key ASDIDvKTNOVGxRpQvFOCN_U8xSpFiZSHjZB0czJAx3AR_Qo

To claim this, I am signing this object:

View gist:68850111f6417292d0d791baa1ca9c71
# Top Screen
bind l:cmd,alt move screenOriginX,screenOriginY screenSizeX/2,screenSizeY 0
bind ;:cmd,alt move screenOriginX,screenOriginY screenSizeX,screenSizeY 0
bind ':cmd,alt move screenOriginX+screenSizeX/2,screenOriginY screenSizeX/2,screenSizeY 0
# Laptop Screen
bind ,:cmd,alt move screenOriginX,screenOriginY screenSizeX/2,screenSizeY 1
bind .:cmd,alt move screenOriginX,screenOriginY screenSizeX,screenSizeY 1
bind /:cmd,alt move screenOriginX+screenSizeX/2,screenOriginY screenSizeX/2,screenSizeY 1
View run.json
{
"properties": {
"name": "",
"source_id": 20133687,
"start": "2020-04-30T07:30:00+10:00",
"distance": 7830.219999999999,
"duration": 2517.044,
"activity_type": "running",
"provider": "smashrun"
},
@sesh
sesh / urls2.0.md
Created Jan 19, 2018
Django URLs 2.0 (MelbDjango Talk)
View urls2.0.md

Django URLs 2.0


Django 2.0

  • Released December, 2017
  • Major features:
    • Only supports Python 3.4 and above
  • Mobile-friendly admin interface
@sesh
sesh / admin.py
Last active Jul 18, 2020
Django Custom User Model
View admin.py
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.utils.translation import ugettext_lazy as _
from .models import User
class CustomUserAdmin(UserAdmin):
fieldsets = (
(None, {'fields': ('email', 'password')}),
View vscode.json
// Pace your settings in this file to overwrite the default settings
{
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"window.zoomLevel": 0,
"files.insertFinalNewline": true,
"editor.insertSpaces": true,
"files.trimTrailingWhitespace": true,
}
View macos-must-haves.md
  • 1password
  • bitbar
  • Caffiene
  • Dash
  • f.lux
  • Handbrake
  • Hemmingway App
  • Homebrew
  • ImageOptim
  • iStat Menus
@sesh
sesh / TUNE.py
Created Mar 9, 2017
Download audio files from youtube links in a reddit thread
View TUNE.py
#!/usr/bin/env python3
"""
Download audio files from youtube links in a reddit thread.
Works a treat on /r/music/
Usage:
./TUNE.py <url>
Requirements: youtube-dl, beautifulsoup4, python>=3.5
View PyPI_BigQuery.md

TIL from reading an early Jan post on the Django mailing list. Turns out that PyPI is making a whole bunch of data available on Google BigQuery.

In a subsequent post, Alex Gaynor gave us a query that extracts Python versions used to download a package on PyPI in the previous two weeks:

SELECT
  REGEXP_EXTRACT(details.python, r"^([^\.]+\.[^\.]+\.[^\.]+)") as python_version,
  COUNT(*) as download_count,
FROM