Skip to content

Instantly share code, notes, and snippets.

@CoconutMacaroon
CoconutMacaroon / mods.md
Last active November 10, 2020 20:29
Teams Mods
void analogWrite(uint8_t pin, int val)
{
// We need to make sure the PWM output is enabled for those pins
// that support it, as we turn it off when digitally reading or
// writing with them. Also, make sure the pin is in output mode
// for consistenty with Wiring, which doesn't require a pinMode
// call for the analog output pins.
pinMode(pin, OUTPUT);
if (val == 0)
{
@CoconutMacaroon
CoconutMacaroon / ImageToExcel.py
Created February 13, 2021 19:08
Converts an image (*.jpg or *.png) to Excel, where one cell in Excel coorosponds with one pixel of the image. Limited to 300x300 images.
from cv2 import imread, imshow, resize, waitKey
from openpyxl.workbook import Workbook
from openpyxl.styles import Color, PatternFill, Font, Border
from openpyxl.styles import colors
from openpyxl.cell import Cell
import click
### These are the variables that can/should be changed as desired ###
# desired image dimensions (maximum approx. 300)
@CoconutMacaroon
CoconutMacaroon / install-modern-unix.sh
Last active July 31, 2021 01:04
Install (some of) the tools from Modern Unix
#!/bin/bash
usage() {
echo "TkFNRQogICBpbnN0YWxsLW1vZGVybi11bml4LnNoIC0gSW5zdGFsbCBzb21lIHVzZWZ1bCB1dGlsaXRpZXMgZnJvbSBNb2Rlcm4gVW5peAoKU1lOT1BTSVMKICAgaW5zdGFsbC1tb2Rlcm4tdW5peC5zaCBbT1BUSU9OXQoKREVTQ1JJUFRJT04KICAgSW5zdGFsbCB1dGlsaXRpZXMgZnJvbSBNb2Rlcm4gVW5peAoKICAgLWEKICAgICAgQ3JlYXRlIGFsaWFzZXMgZm9yIGNvbW1hbmRzIGJlaW5nIGluc3RhbGxlZCBpbiB+Ly5iYXNocmMKCiAgIC1iCiAgICAgICBJbnN0YWxsIGJhdCwgYSByZXBsYWNlbWVudCBmb3IgY2F0CgogICAtZAogICAgICBJbnN0YWxsIGR1ZiwgYSByZXBsYWNlbWVudCBmb3IgZHUKCiAgIC1oCiAgICAgICBQcmludCB0aGlzIGhlbHAKCiAgIC1sCiAgICAgICBJbnN0YWxsIGxzZCwgYSByZXBsYWNlbWVudCBmb3IgbHMgLSBBUk0gdmVyc2lvbgoKICAgLWYKICAgICAgIEluc3RhbGwgZnNmLCBhIGZ1enp5LWZpbmRlcgoKICAgLXQKICAgICAgIEluc3RhbGwgdGxkciwgaGVscC1wYWdlcyB3aXRoIGV4YW1wbGVzIGZvciBjb21tYW5kcyAtIFJlcXVpcmVzIG5vZGUuanMvbnBtIHRvIGJlIGluc3RhbGxlZAo=" |
base64 --decode
}
update() {
sudo apt-get update
}
@CoconutMacaroon
CoconutMacaroon / fusor_style_guide.md
Last active November 10, 2021 00:42
Fusor Style Guide

Fusor Control Style Guide

This style guide is an attempt to standardize the style used in Fusor Control. This applies to the Java (.java) files and the Arduino (.ino) files. If something is only for Java, it has been noted.

Headers

Yes, I'm aware that the JavaDoc syntax is designed for Java, not Arduino. However, comments in JavaDoc format should be in both Java and Arduino source code files.

Each Java or Arduino source code file should have a file header that includes the author, the date last modified, and the purpose of the file. This should be before any import or package statements in Java, and should be before any #includes in Arduino.

# /etc/ssh/sshd_config
# this is a good SSH config that is secure
# also always use keys, not passwords!
HostKeyAlgorithms ssh-ed25519,rsa-sha2-512,rsa-sha2-256
KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group18-sha512,diffie-hellman-group16-sha512,diffie-hellman-group14-sha256
MACs umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com
PasswordAuthentication no
PermitRootLogin yes

These images and their descriptions are licensed under the CC BY-SA 4.0


Mountainous sunset with moon Mountainous sunset with moon

Photo taken Tuesday, July 12th on i90 in Washington State, USA, near to Lake Keechelus

// ==UserScript==
// @name Charcoal Team Sidebar Link
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Re-adds a link to the Charcoal team to the sidebar
// @author You
// @match https://stackoverflow.com/
// @icon https://www.google.com/s2/favicons?sz=64&domain=stackoverflow.com
// @grant none
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am coconutmacaroon on github.
  • I am cocomac (https://keybase.io/cocomac) on keybase.
  • I have a public key ASBDBxi5VFdwcxHuKTaNJOlY3qKYODbl61YfDWlUpBrW3Ao

To claim this, I am signing this object:

Copyright 2022 CoconutMacaroon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O