Skip to content

Instantly share code, notes, and snippets.

View bmatusiak's full-sized avatar
👌
Having Fun

Bradley Matusiak bmatusiak

👌
Having Fun
View GitHub Profile
uint32_t baud;
uint32_t old_baud;
void loop() {
// put your main code here, to run repeatedly:
baud = Serial.baud();
if (baud != old_baud) {
/*************************************
* Dual Channel DC Motor Driver Board*
* Code Written by Idayu - MYBOTIC *
*************************************/
int IN1 = 12;
int IN2 = 11;
int IN3 = 7;
int IN4 = 6;
@bmatusiak
bmatusiak / cs-gcode.js
Last active November 11, 2020 20:04
cgode checksum cs *:
// N0 M106*36
// N1 G28*18
// N2 M107*39
getCS("N0 M106");
getCS("N1 G28");
getCS("N2 M107");
@bmatusiak
bmatusiak / mac-terminal-bash-colors.bash_profile
Created July 22, 2020 23:41
mac bash colors bash_profile
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
#PS1="\h:\W \u\$" # Default
PS1="\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "
var key1Name = "test13";
var key2Name = "test22";
// "hex" or "base64", default is raw(Uint8Array)
var encoding = "hex";
////-----------------------
var atob = require("atob");
var btoa = require("btoa");
#!/bin/bash
modprobe libcomposite
command="$1" # "up" or "down"
gadgetDevice="/sys/kernel/config/usb_gadget/my_gadget"
usb_up() {
// cloud9 nvm node runner
{
"script": [
"source $HOME/.nvm/nvm.sh",
"set -e",
"if ! [ \"$debug\" == true ]; then ",
" node \"$file\" $args",
"elif \"$(node -p 'parseInt(process.version.slice(1)) < 7')\" == true; then",
" FLAGS=\"--nocrankshaft --nolazy --debug-brk=$debugport\"",
" if node --nodead_code_elimination -e '' &> /dev/null; then",
@bmatusiak
bmatusiak / in-out.gun.js
Created June 1, 2020 15:39
form Dletta
/*
To have abstract application keys into a keychain, so you can keep
your keys (aka one login, but many apps) without having to constantly
shift your logins between applications or shared documents
We do this by:
- Initiate 2 instances of gun.
- The main user instance will act as you, using a key chain to keep key pairs
that apps may generate.
- All keys will be encrypted to yourself, which means only you will be able to access
var alive = false;
function setupChat(leave_trigger_fn) {
alive = true;
if (!gunky) {
gunky = new imports.gunky(gun.get("chatapp-10").get("events"), true);
gunky.me = new imports.gunky(gun.get(gunky.emitter_id).get("events"), true);
gunky.me.on("user-alive", function(id, name) {
var user_tag = userTag(id, name);
/*
http://www.JSON.org/json2.js
2011-10-19
Public Domain.
NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
See http://www.JSON.org/js.html