Skip to content

Instantly share code, notes, and snippets.

View brandonaaskov's full-sized avatar

Brandon Aaskov brandonaaskov

  • rocketinsights
  • Maine, USA
View GitHub Profile
@brandonaaskov
brandonaaskov / Trauma Kits.md
Last active June 9, 2023 22:14
Trauma Kits: How to shop for what you need
View Trauma Kits.md

Trauma Kit Crash Course

There are so many, most of them are very alike, and basically it boils down to having just the right stuff but not too much of the things you likely won't need. If you get a kit that has a bag with extra space, you can easily customize your loadout. In a trauma situation, you want to access the essentialls immediately, not sifting through band-aids to find compression gauze.

IFAK

A quick note on this acronmyn. It means "individual first aid kit", but seems to come up more frequently around trauma kits and military supply. Don't let someone peddle you a standard first aid kit: you don't want that.

Warrior Poet Society

This is a good place to start since it's a no-frills setup. But that ankle-holster medkit for EDC is pretty great. My jeans just wouldn't allow it.

Here’s what you definitely want in a trauma kit. Whether it be in your car, home, or range bag, you’ll just have to decide the quantity of items. This is NOT a first aid kit. There are no splints, triangular bandages

@brandonaaskov
brandonaaskov / wallet-connect-rpc-chain-ids.js
Last active May 30, 2022 18:35
WalletConnect can take an optional collection of RPC endpoints paired with their chain ID. This list includes some IDs not found on chainlist.org.
View wallet-connect-rpc-chain-ids.js
// Chain IDs for Ethereum (source: https://docs.metamask.io/guide/ethereum-provider.html#chain-ids)
// Hex Dec Network
// 0x1 1 Ethereum Main Network (Mainnet)
// 0x3 3 Ropsten Test Network
// 0x4 4 Rinkeby Test Network
// 0x5 5 Goerli Test Network
// 0x2a 42 Kovan Test Network
// Look up chainid.network to get a (somewhat) comprehensive list of chain IDs (EVM-based)
@brandonaaskov
brandonaaskov / garden-water.ino
Last active June 18, 2020 17:56
Moisture soil sensor
View garden-water.ino
int soilPin = A0;
int soilPower = 7;
void setup()
{
Serial.begin(9600); // open serial over USB
pinMode(soilPower, OUTPUT);
digitalWrite(soilPower, LOW);
}
@brandonaaskov
brandonaaskov / airplay-with-javascript-example.js
Last active May 10, 2020 18:22
Activating AirPlay via Javascript Example
View airplay-with-javascript-example.js
<!DOCTYPE html>
<html>
<head>
<title>AirPlay Javascript Demo</title>
<script>
document.addEventListener('DOMContentLoaded', () => {
const player = document.querySelector("#player")
const button = document.querySelector("#airplay-button")
let isAirPlayAvailable = false
@brandonaaskov
brandonaaskov / movies.test.js
Created January 18, 2020 23:09
Example file testing nuxt stores
View movies.test.js
import _ from "lodash"
import Vuex from "vuex"
import { createLocalVue } from "@vue/test-utils"
describe("store/movies", () => {
// ----------------------------------------------------
// focus on the code from here...
const localVue = createLocalVue()
localVue.use(Vuex)
let NuxtStore
@brandonaaskov
brandonaaskov / jest.setup.js
Last active January 18, 2020 23:16
Jest setup file for testing nuxt stores
View jest.setup.js
import { Nuxt, Builder } from "nuxt"
import nuxtConfig from "./nuxt.config"
// these boolean switches turn off the build for all but the store
const resetConfig = {
loading: false,
loadingIndicator: false,
fetch: {
client: false,
server: false
@brandonaaskov
brandonaaskov / jest.config.js
Last active January 18, 2020 23:09
Jest config file that adds one-time setup file before test suites start running
View jest.config.js
module.exports = {
globalSetup: "<rootDir>/jest.setup.js", // this line is the only change here
moduleNameMapper: {
"^@/(.*)$": "<rootDir>/$1",
"^~/(.*)$": "<rootDir>/$1",
"^vue$": "vue/dist/vue.common.js"
},
moduleFileExtensions: ["js", "vue", "json"],
testEnvironment: "jsdom",
transform: {
View vuex-helpers-examples.js
// YUCKY VERSION
// using mapGetters with an array of strings
export default {
computed: {
...mapGetters(['movies/byStudio']),
disneyMovies () {
// this is the yucky part
return this['movies/byStudio']('Disney')
}
}
@brandonaaskov
brandonaaskov / deck_of_cards.json
Created October 29, 2019 18:41 — forked from darthneel/deck_of_cards.json
JSON structure for a standard playing card deck
View deck_of_cards.json
[
{
"suit": "hearts",
"value": 2
},
{
"suit": "hearts",
"value": 3
},
{
@brandonaaskov
brandonaaskov / international-number-formatter.js
Created January 27, 2019 17:32
Uses vanilla JS to format numbers for different locales.
View international-number-formatter.js
const formattedNumber = (value, decimals = 2, locale = 'pt-BR') => {
const oNumber = new Intl.NumberFormat(locale, {
maximumFractionDigits: decimals,
minimumFractionDigits: decimals
});
return oNumber.format(value);
};
formattedNumber(889999) // 889.999,00