This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// James Cheese 2021 - based on example at https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode | |
// Build an audio context of whatever type's available | |
let SupportedAudioContext = null; | |
if (window.AudioContext !== undefined) { | |
SupportedAudioContext = window.AudioContext; | |
} else if (window.webkitAudioContext !== undefined) { | |
SupportedAudioContext = window.webkitAudioContext; | |
} | |
const silentAudioContext = new SupportedAudioContext(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on @sandyjmacdonald's original gist: | |
# https://gist.github.com/sandyjmacdonald/b465377dc11a8c83a8c40d1c9b990a90 | |
import time | |
import board | |
import busio | |
import usb_hid | |
from adafruit_bus_device.i2c_device import I2CDevice | |
import adafruit_dotstar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createMuiTheme } from "@material-ui/core"; | |
/* | |
Generates a random theme for Material-UI. Usually horrible. | |
*/ | |
const randomColor = () => { | |
return ["#",Math.floor((Math.random()*16)).toString(16),Math.floor((Math.random()*16)).toString(16),Math.floor((Math.random()*16)).toString(16),Math.floor((Math.random()*16)).toString(16),Math.floor((Math.random()*16)).toString(16),Math.floor((Math.random()*16)).toString(16)].join(""); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Dark colour scheme for MarkdownEditor (https://github.com/madskristensen/MarkdownEditor) | |
* | |
* Licensed under MIT license. | |
* | |
* Copyright (c) 2018 James Cheese | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First install GDAL as a wheel from: http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal | |
# Then ensure the following are added to your local settings.py (check the dll name, this may change!) | |
GDAL_LIBRARY_PATH = r"env\Lib\site-packages\osgeo\gdal200.dll" | |
environ["PATH"] = "{};{}".format(r"env\Lib\site-packages\osgeo", environ["PATH"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- rabbitmq-env-orig.bat Tue Oct 11 12:16:01 2016 | |
+++ rabbitmq-env.bat Tue Oct 11 12:10:18 2016 | |
@@ -1,10 +1,12 @@ | |
@echo off | |
REM Scopes the variables to the current batch file | |
REM setlocal | |
+set /p COOKIE_VALUE=<%HOMEDRIVE%%HOMEPATH%\.erlang.cookie | |
+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models, migrations | |
class Migration(migrations.Migration): | |
dependencies = [] | |
operations = [ | |
migrations.RunSQL("CREATE EXTENSION IF NOT EXISTS postgis") | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am tr00st on github. | |
* I am jamescheese (https://keybase.io/jamescheese) on keybase. | |
* I have a public key whose fingerprint is 6F3C F8FD 4114 7718 A16E A759 8D3B AE8A 8E0A A400 | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple colour-coded prompts for BASH usage - red=live, blue=test, green=dev | |
#live: | |
export PS1="\[$(tput bold)\]\[\033[38;5;9m\]\u@\h\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]:\w\\$\[$(tput sgr0)\] " | |
#test: | |
export PS1="\[$(tput bold)\]\[\033[38;5;39m\]\u@\h\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]:\w\\$\[$(tput sgr0)\] " | |
#dev: | |
export PS1="\[$(tput bold)\]\[\033[38;5;119m\]\u@\h\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;15m\]:\w\\$\[$(tput sgr0)\] " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove legacy SSL support. If you really need it, you're supporting IE6 yourself. Sorry. | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
# Settings for cached SSL sessions. | |
ssl_session_cache shared:SSL:50m; | |
ssl_session_timeout 5m; | |
# Choose some DH params: |
NewerOlder