Skip to content

Instantly share code, notes, and snippets.

View paalwilliams's full-sized avatar
🎯
Focusing

Paal Williams paalwilliams

🎯
Focusing
View GitHub Profile
@paalwilliams
paalwilliams / instanceFactory.ts
Last active November 11, 2023 15:11
Strongly typed Class Instantiator Function Blueprint
class Animal {
public legs: number;
public fur: boolean;
public sound: string;
constructor(legs: number, fur: boolean, sound: string) {
this.legs = legs;
this.fur = fur;
this.sound = sound;
}
@paalwilliams
paalwilliams / gist:c5ecb2a86f83f2eaa861d7bff02cc7ef
Created February 18, 2021 05:02
Apache .htacces config for wordpress w/ react-router
# Redirect all requests for non-existent files and those not for wp-admin or wp-json
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/wp-admin
RewriteCond %{REQUEST_URI} !^/wp-json
RewriteRule ^ / [R=301,L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
@paalwilliams
paalwilliams / docker-compose.yaml
Last active September 15, 2021 22:19
Docker Compose File for Wordpress
version: '3'
services:
# Database
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
@paalwilliams
paalwilliams / indexplus.html
Last active May 18, 2020 03:56
Fix Watney Info button
<div id="info" tabindex="-1" style="display: none">
<pre>Controls:
Arrow keys: move the rover
Shift: slow movement
A: look up
Z: look down
S: Text to speech
V: Push-to-talk
</pre>
</div>
@paalwilliams
paalwilliams / excerpt_janus.js
Created May 12, 2020 19:46
fix for watney janus.js w/ cors
fetching
.then(function (response) {
if (response.status > 199 && response.status < 400) {
if (typeof options.success === typeof Janus.noop) {
return response
.json()
.then(function (parsed) {
options.success(parsed);
})
.catch(function (error) {
@routes.post("/sendCommand")
async def setCommand(request):
commandObj = await request.json()
newBearing = commandObj['bearing']
newLook = commandObj['look']
newSlow = commandObj['slow']
if newBearing in MotorController.validBearings:
motorController.setBearing(newBearing, newSlow)
else:
@paalwilliams
paalwilliams / CCF_googlecloudprint_config.md
Last active June 24, 2020 23:29
Google Cloud Printer Configuration for Raspberry PI - Crazy Cheap Fireworks
@paalwilliams
paalwilliams / clone_wp_multisite_aws_bitnami.md
Last active May 15, 2020 02:52
Clone Wordpress Multisite on AWS

Clone an AWS instance

Instructions from here https://docs.bitnami.com/aws/faq/administration/clone-server/

  • Log in to the AWS Management Console.

  • If required, use the region selector in the top right corner to switch to the region where your instance was launched.

  • Select your instance and then select the “Create Image” option in the “Actions” menu.

<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
</head>
<body>
<script
type="text/javascript"
src="http://lhgallery.pwmd.biz/ndxzsite/js/watney/jquery.min.js"
></script>
<script
type="text/javascript"
src="http://lhgallery.pwmd.biz/ndxzsite/js/watney/jquery.ui.min.js"
></script>
<link
rel="stylesheet"