Skip to content

Instantly share code, notes, and snippets.

Avatar

Keith Weaver keithweaver

View GitHub Profile
View game-status.json
{
"isLive": true,
"isDeprecated": false,
"splashScreenMessage": "",
"menuTopMessage": "",
"minimumGameVersion": 1
}
@keithweaver
keithweaver / status.json
Created Jul 17, 2019
The status of the Local Network application.
View status.json
{
"version": 1,
"isLive": true,
"message": "The application is still live, check keithweaver.ca"
}
View whn.json
{"host_id": "foobar", "keiths_windows_desktop": "192.168.2.11", "corenetwork": "192.168.2.34", "dnsapi": "192.168.2.34"}
@keithweaver
keithweaver / with-pre-record-step1.py
Created Dec 16, 2018
Sample code used in http://localhost:3000/docs/tutorial/smart-dashcam
View with-pre-record-step1.py
def delete_image(image_object):
# TODO
print ('delete_image')
def process_image(image_object):
# TODO
print ('process_image')
def get_image_from_path(image_path):
print ('get_image_from_path')
@keithweaver
keithweaver / with-pi-cam-step1.py
Last active Dec 16, 2018
Sample code used in http://localhost:3000/docs/tutorial/smart-dashcam
View with-pi-cam-step1.py
def delete_image(image_object):
# TODO
print ('delete_image')
def process_image(image_object):
# TODO
print ('process_image')
def take_image_from_pi_cam():
print ('insert_take_image')
View index.json
{
"reservedWords": ["default", "index","custom"],
"themes": {
"default": {
"json": "https://gist.githubusercontent.com/keithweaver/6b87e9f0bf559c81d8201f3e4b33b262/raw/230c89c855338aee6ae865bd575d6421923fe25a/default.json",
"css": "../themes/default.css"
},
"custom": {}
}
}
View default.json
{
"if": {
"classNames": [ "demo" ]
}
}
@keithweaver
keithweaver / FollowCamera.cs
Created Jun 12, 2018
Move the camera when the mouse reaches the edge of the screen.
View FollowCamera.cs
// Attach to the camera asset
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FollowCamera : MonoBehaviour {
private int screenWidth;
private int screenHeight;
public int speed = 5;
@keithweaver
keithweaver / signin.js
Last active Dec 11, 2018
Sign in endpoints
View signin.js
const User = require('../../models/User');
const UserSession = require('../../models/UserSession');
module.exports = (app) => {
/*
* Sign up
*/
app.post('/api/account/signup', (req, res, next) => {
const { body } = req;
@keithweaver
keithweaver / Home.js
Last active Mar 22, 2020
Sign up/in form in React.js
View Home.js
import React, { Component } from 'react';
import 'whatwg-fetch';
import {
getFromStorage,
setInStorage,
} from '../../utils/storage';
class Home extends Component {
constructor(props) {
You can’t perform that action at this time.