Skip to content

Instantly share code, notes, and snippets.

View WoodyWoodsta's full-sized avatar
🏄‍♂️
🇿🇦🇬🇧

Sean Wood WoodyWoodsta

🏄‍♂️
🇿🇦🇬🇧
View GitHub Profile

#local-npm setup To install service for local-npm using forever-service:

$ sudo rm /usr/bin/node

$ sudo ln -s "$(which node)" /usr/bin/node

$ sudo forever-service install local-npm-service --script /home/<user>/.nvm/versions/node/<node-version>/lib/node_modules/local-npm/bin.js -o " -d /home/<user>/.local-npm" -p /home/<user>/.nvm/versions/node/<node-version>/bin --start
@WoodyWoodsta
WoodyWoodsta / includeGuard.h
Last active October 27, 2015 09:23
Multiple inclusion guard tactic for C explained
/** To prevent your code having multiply included header files,
* and hence possibly multiply declared functions and variables,
* the following tactic is used in the file to be included which will
* prevent the code from being compiled more than once.
*/
// The "ifndef" combined with the matching "endif" directives serve as a pre-processor
// "if not defined" statement, where the code between these two directives will only
// Be compiled if, in this case, the symbol "NAME_OF_HEADER_FILE_H" has not been defined.
STM32F0x -> STLinkv2:
sudo openocd -f interface/stlink-v2.cfg -f target/stm32f0x_stlink.cfg
@WoodyWoodsta
WoodyWoodsta / LEDBlinkSTM32F051C6.c
Created July 14, 2015 18:50
LED Blink example using register accessing
// Paste this at the top of your main file
#define EVER ;;
#define RCC_PERHIPHBASE 0x40021000
#define RCC_AHBENR (RCC_PERHIPHBASE + 0x14)
#define GPIOB_PERIPHBASE 0x48000400
#define GPIOB_MODER (GPIOB_PERIPHBASE + 0x00)
#define GPIO_ODR (GPIOB_PERIPHBASE + 0x14)