Skip to content

Instantly share code, notes, and snippets.

View robertcedwards's full-sized avatar
🖼️
Framing

Robert C Edwards robertcedwards

🖼️
Framing
View GitHub Profile
@robertcedwards
robertcedwards / Move.cs
Last active February 25, 2024 22:27
Movement Script in C# for Unity
private float speed = 2.0f;
public GameObject character;
void Update () {
if (Input.GetKey(KeyCode.RightArrow)){
transform.position += Vector3.right * speed * Time.deltaTime;
}
if (Input.GetKey(KeyCode.LeftArrow)){
transform.position += Vector3.left* speed * Time.deltaTime;
@robertcedwards
robertcedwards / sample_nested.json
Last active October 9, 2023 17:49
Sample nested json data for boilerplate coffee data
{
"coffee": {
"region": [
{"id":1,"name":"John Doe"},
{"id":2,"name":"Don Joeh"}
],
"country": {"id":2,"company":"ACME"}
},
"brewing": {
"region": [
@robertcedwards
robertcedwards / random-prefab.cs
Created December 24, 2015 11:31
Spawn random prefab in Unity
Transform[] prefabs;
void SpawnANewOne() {
int index = Random.Range(0, prefabs.Count);
Transform randomPrefab = prefabs[index];
Instantiate(randomPrefab);
}
@robertcedwards
robertcedwards / TinyTS_v11.ino
Created March 8, 2017 02:22
The Tiny-TS Touch Synthesizer
// (*) All in the spirit of open-source and open-hardware
// Janost 2016 Sweden
// The Tiny-TS Touch Synthesizer
// https://janostman.wordpress.com/the-tiny-ts-diy-touch-synthesizer/
// Copyright 2016 DSP Synthesizers Sweden.
//
// Author: Jan Ostman
//
// This program is free software: you can redistribute it and/or modify
@robertcedwards
robertcedwards / Gumroad.html
Last active March 27, 2023 17:36
Gumroad buttons
<script type="text/javascript" src="https://gumroad.com/js/gumroad.js"> </script>
<a href="https://gum.co/XXXX" class="gumroad-button">Buy my product</a>
var myHeaders = new Headers();
var ETagHeaders = new Headers();
myHeaders.append("x-api-key", "INSERT API KEY");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
@robertcedwards
robertcedwards / kazm-embed.html
Created November 10, 2022 16:30
Embedded Kazm Form for Ambire Sign-up
<object data="https://kazm.xyz/invite/118b9d35-0def-4de5-8ec8-fadb82650c04"
width="450"
height="550"
type="text/html">
Alternative Content
</object>
@robertcedwards
robertcedwards / Assetto-dash.py
Created August 18, 2015 23:58
Assetto Corsa Fan Control using Python API & Arduino
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "dll"))
import ac
import acsys
import serial
import time
#ser = serial.Serial(3, 9600)
sudo gem update –-system
let widget = await createWidget()
if (config.runsInWidget) {
Script.setWidget(widget)
} else {
widget.presentMedium()
}
Script.complete()