Skip to content

Instantly share code, notes, and snippets.

View dubpirate's full-sized avatar
🏠
whats good

William dubpirate

🏠
whats good
  • Calibrate Marketing
  • Auckland, New Zealand
View GitHub Profile
@dubpirate
dubpirate / pascal_to_snake.py
Last active August 4, 2022 23:02
Convert Pascal Case to Snake Case with Python and Regex.
import re
def to_snake(pascal:str) -> str:
"""Converts a Pascal case string to snake case.
"""
magic = re.findall('[A-Z]+[a-z]*', pascal)
snake = '_'.join(magic)
snake = snake.lower()
return snake
@dubpirate
dubpirate / feynman.json
Created April 19, 2022 04:47
Example json-dl video object for the Feynman video.
{
"@context": "https://schema.org",
"@type": "VideoObject",
"name": "Introducing The Feynman.",
"description": "Marking our return to Great North Road – and to the greatest of neighbourhoods – The Feynman stands at the nexus of Grey Lynn, Ponsonby, K’ Road and Kingsland. The best of all worlds, here.",
"thumbnailUrl": [
"https://www.ockham.co.nz/assets/resized/sm/upload/zt/ns/oh/vj/Feynman_Ext_GtNorth_CamA_Final02-0-2880-0-0.jpg?k=872a4fef2e",
"https://www.ockham.co.nz/assets/resized/sm/upload/2p/su/w5/vf/Feynman_Ext_GtNorth_CamC_Final03-0-2880-0-0.jpg?k=5e83a35d1f",
"https://www.ockham.co.nz/assets/resized/sm/upload/r3/2n/fy/oi/Feynman_Ext_Roof_Deck_Final02-0-2880-0-0.jpg?k=93b332c1e3"
],
{
"@context": "https://schema.org",
"@type": "HomeAndConstructionBusiness",
"image": [
"https://example.com/photos/1x1/photo.jpg",
"https://example.com/photos/4x3/photo.jpg",
"https://example.com/photos/16x9/photo.jpg"
],
"name": "Ockham Residential",
"currenciesAccepted": "NZD",
@dubpirate
dubpirate / definitions.html
Created April 2, 2022 06:20
Get to da Java!
<article id="definitions" class="content">
<h1>Definitions</h1>
<section class="summary" data-class-title="AbstractActivity">
<h1 class="api-title"><a name="/definitions/AbstractActivity"></a>AbstractActivity </h1>
<div class="params -properties">
<h2>Properties</h2>
<table>
@dubpirate
dubpirate / spnet.php
Created December 15, 2021 00:45
Accessing SPNet fields
<?php // There does not seem to be any documentation for spnet so I thought I would through this up. ?>
<?php echo get_post_meta($post->ID, 'spnet_XXXXXX', true); ?>
<?php // get_post_meta docs: https://developer.wordpress.org/reference/functions/get_post_meta/ ?>
@dubpirate
dubpirate / torkinwill.md
Last active October 22, 2020 08:52
COMP313 Code Reflection

Code Reflection

22|10|20

Header Info

  • William Torkington
  • torkinwill
  • Lead Developer

Code Discussion

@dubpirate
dubpirate / Wikipedia.md
Created September 24, 2020 00:02
I'm on Wikipedia

It is I, Will.torkington

I know you're super curious to know who this mysterious Will.torkington is on Wikipedia is. Well, I'm here to tell you that it is infact me, William Torkington. Yes, yes, I know, shock, horror, denial.

I will update this gist with some pages I've edited or created, once I'm proud of any. For the mean time, check out my GitHub page and please give me a job.

@dubpirate
dubpirate / start_obs_mac.sh
Created May 16, 2020 01:37
This runs the OBS program as installed in the gist.
cd ./obs-studio/build/rundir/RelWithDebInfo/bin
./obs
#xcode-select --install
#/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# This file is shamelessly stolen from the Medium article:
# https://medium.com/@jkudo/how-to-use-a-virtual-camera-for-zoom-microsoft-teams-and-google-meet-in-obs-for-macos-2ffc831dd76b
# Clone and build OBS
git clone --recursive https://github.com/obsproject/obs-studio.git
@dubpirate
dubpirate / keybase.md
Created April 29, 2020 23:17
Verifying my Identity for Keybase

Keybase proof

I hereby claim:

To claim this, I am signing this object: