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 / gist:08e4c30ad223256ccbf3
Created January 27, 2016 08:01
EACCES Error on install
You need to reclaim ownership of the .npm directory.
sudo chown -R whoami ~/.npm
and need the write permission in node_modules directory:
sudo chown -R whoami /usr/local/lib/node_modules
<form method=POST action="<? urldecode(GET['login_url']) ?>">
<input type="hidden" name="success_url" value="<? urldecode(GET['continue_url']) ?>" />
Username: <input type ="text" name="username" />
Password: <input type ="text" name="password" />
<input type="submit" value="Login" />
using UnityEngine;
using Valve.VR;
public class InputControllerVive : MonoBehaviour
{
public static bool LeftIsPressed;
public static bool RightIsPressed;
uint left = 0;
uint right = 0;
@robertcedwards
robertcedwards / add_haptic.cs
Created December 29, 2015 20:06
Adding haptic when trigger is pulled
if(SteamVR_Controller.Input(deviceIndex).GetPressDown(SteamVR_Controller.ButtonMask.Trigger))
SteamVR_Controller.Input(deviceIndex).TriggerHapticPulse(100);
@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 / vive-controller.js
Created December 24, 2015 10:50
Unity Vive Trigger
using UnityEngine;
using Valve.VR;
public class InputControllerVive : MonoBehaviour
{
public static bool LeftIsPressed;
public static bool RightIsPressed;
uint left = 0;
uint right = 0;
@robertcedwards
robertcedwards / Move.cs
Last active April 26, 2025 07:32
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 / dustins-display.ino
Created November 12, 2015 20:18
Gist for Particle.io Photon to display an image on Sharp Memory LCD
/*********************************************************************
This is an example sketch for our Monochrome SHARP Memory Displays
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/1393
These displays use SPI to communicate, 3 pins are required to
interface
Adafruit invests time and resources providing this open source code,
@robertcedwards
robertcedwards / dustinswords.ino
Last active October 14, 2015 17:18
Dustin's Words Code
#include "clickButton/clickButton.h"
#include "neopixel/neopixel.h"
#define NEOPIXEL_PIN D7 //data pin for the neopixel LEDs
#define NEOPIXEL_COUNT 6 //# of LEDs
#define NEOPIXEL_TYPE WS2812B //type of LEDs
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NEOPIXEL_COUNT, NEOPIXEL_PIN, NEOPIXEL_TYPE); //setup neopixel strip
const int buttonPin1 = 1;
ClickButton button1(buttonPin1, HIGH, CLICKBTN_PULLUP);
const int buttonPin2 = 2;
@robertcedwards
robertcedwards / Supplements + Mixpanel.markdown
Last active September 26, 2015 07:13
Supplements + Mixpanel