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 / teensy-usbmidi-code.ino
Created October 27, 2016 18:46
usbmidi library example with FastLED library.
#include <FastLED.h>
#define NUM_LEDS 14
#define DATA_PIN 5 // Green
#define CLOCK_PIN 6 // Blue
CRGB leds[NUM_LEDS];
void OnProgramChange(byte channel, byte program) {
delay(500);
if (usbMIDI.getChannel() == 1 && usbMIDI.getData1() == 8) // MIDI CC 8, Channel 1
@robertcedwards
robertcedwards / npm-fix.md
Created October 2, 2016 03:37
Fixing NPM permissions - You may receive an EACCES error when you try to install a package globally. This indicates that you do not have permission to write to the directories that npm uses to store global packages and commands.

Option 2: Change npm's default directory to another directory

There are times when you do not want to change ownership of the default directory that npm uses (i.e. /usr) as this could cause some problems, for example if you are sharing the system with other users.

Instead, you can configure npm to use a different directory altogether. In our case, this will be a hidden directory in our home folder.

Make a directory for global installations:

mkdir ~/.npm-global Configure npm to use the new directory path:

In the terminal, do this:
defaults write com.apple.finder CreateDesktop -bool false && killall Finder
After this, there'll be nothing on your Desktop (but still in ~/Desktop, i.e. your Desktop Folder). It'll look like this:
Clean Desktop
Beautiful, isn't it? If you want to change it back:
defaults write com.apple.finder CreateDesktop -bool true && killall Finder
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@robertcedwards
robertcedwards / rfid-node.ino
Created August 14, 2016 02:24 — forked from suhajdab/rfid-node.ino
Particle Photon + RC522 RFID implant reader
#include "MFRC522/MFRC522.h"
/*
Function Core Pin MRFC522 Pin
Reset D2 RST
SPI SS D1 SDA
SPI MOSI A5 MOSI
SPI MISO A4 MISO
SPI SCK A3 SCK
*/
@robertcedwards
robertcedwards / sumhub_settings.ino
Created May 29, 2016 05:59
Simhub Arduino File for my setup
// F revision sketch
// ----------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ----------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ----------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ----------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ----------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ----------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ----------------------------------------------------- PLEA
@robertcedwards
robertcedwards / gist:13e6398c2d2f14efd61e079a50dc134c
Created May 11, 2016 01:59
My input setup for Thrustmaster TX, TP3Pro Pedals, ACT Labs Shifter
[HEADER]
INPUT_METHOD=WHEEL
[X360]
STEER_THUMB=LEFT
STEER_GAMMA=1
STEER_FILTER=0.22
SPEED_SENSITIVITY=0.73
STEER_DEADZONE=0.0
@robertcedwards
robertcedwards / rpm.py
Created April 21, 2016 07:04
RPM Version of Assetto Corsa Dash
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)
@robertcedwards
robertcedwards / steam.ini
Created April 7, 2016 15:17
Steam Controller ini config file for Assetto Corsa
[HEADER]
INPUT_METHOD=X360
[X360]
STEER_THUMB=LEFT
STEER_GAMMA=2.0
STEER_FILTER=0.7
SPEED_SENSITIVITY=0.1
STEER_DEADZONE=0.0