This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="HandheldFriendly" content="true"> | |
<style> | |
button { font-size: xx-large; } | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getUuid = (i) => { | |
const num = i.toString(); | |
const id = ("0").repeat((4 - num.length) > 0 ? (4 - num.length) : 0) + num; | |
return 'd7e5' + id + '-0109-4306-956f-2f725ba7a85d'; | |
}; | |
var s = new Serial(); | |
s.setup(9600,{rx: D33, tx: D34}); | |
let buffer = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="HandheldFriendly" content="true"> | |
<style> | |
button { font-size: xx-large; } | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const neopixel = require("neopixel"); | |
const numPixels = 7; | |
const pixelPin = 29; | |
const filledArr = (val, length) => { | |
const arr = new Uint8ClampedArray(length); | |
return arr.fill(val); | |
}; | |
const emptyArr = (length) => { | |
return filledArr(0, length); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const P1_01 = 33; | |
const P1_02 = 34; | |
const P1_12 = 44; | |
const P1_13 = 45; | |
const P1_14 = 46; | |
const A = { | |
MOSI: 11, | |
MISO: 12, | |
SCK: 13, | |
SDA: 28, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let pressCount = 0; | |
const batteryPercentage = () => (NRF.getBattery() - 2) * 100; | |
const LIGHT = 0xFFFF; | |
const FAN = 0xFFFE; | |
const LIGHT_FAN_ON = 0xFFFD; | |
const LIGHT_FAN_OFF = 0xFFFC; | |
E.on("init", () => { | |
NRF.setAdvertising({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/false | |
# This file is part of Espruino, a JavaScript interpreter for Microcontrollers | |
# | |
# Copyright (C) 2013 Gordon Williams <[email protected]> | |
# | |
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
# | |
# ---------------------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Dump firmware from nrf51 and maybe other cortex-m devices | |
# The script thats missing from http://blog.includesecurity.com/2015/11/NordicSemi-ARM-SoC-Firmware-dumping-technique.html | |
# Also inspired by https://tasteless.eu/post/2015/12/32c3ctf-emb400/ | |
# Requires seperate instace gdb server already running, for my jlink I use | |
# openocd -f interface/jlink.cfg -c "adapter_khz 2000; transport select swd;" -f target/nrf51.cfg | |
# uicr and ficr are always accessible so you might want to dump those externally and compare? | |
# openocd -f interface/jlink.cfg -c "adapter_khz 2000; transport select swd; set WORKAREASIZE 0;" -f target/nrf51.cfg -c "init; reset halt; flash read_bank 1 uicr-normal.bin 0x0 0x100; exit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const UPDATE_EDITOR_CONTENT = 'mock_test/UPDATE_EDITOR_CONTENT'; | |
export const updateMockTestContent = (testId: number, content: string) => ({ | |
type: UPDATE_EDITOR_CONTENT, | |
testId, | |
content, | |
}); | |
handlers[UPDATE_EDITOR_CONTENT] = (state, action) => { | |
const { testId, content } = action; | |
return state | |
.setIn(['tests', 'items', testId, 'answer'], content) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install libraries | |
sudo apt install git variety build-essential htop python3-pip curl openssh-server screen | |
# install docker dependencies | |
sudo snap install docker | |
sudo groupadd docker | |
sudo usermod -aG docker $USER | |
pip3 install docker-compose | |
snap install kubectl --classic |
NewerOlder