Skip to content

Instantly share code, notes, and snippets.

View rjp44's full-sized avatar

Rob Pickering rjp44

View GitHub Profile
from microbit import *
# From https://support.microbit.org/support/solutions/articles/19000070728-how-to-read-the-device-serial-number
def get_serial_number():
NRF_FICR_BASE = 0x10000000
DEVICEID_INDEX = 25 # deviceid[1]
@micropython.asm_thumb
def reg_read(r0):
ldr(r0, [r0, 0])
const path = require('path');
const webpack = require('webpack');
const rootDirectory = path.resolve(__dirname, '../');
const appDirectory = path.resolve(__dirname, '../app');
// This is needed for webpack to compile JavaScript.
// Many OSS React Native packages are not compiled to ES5 before being
// published. If you depend on uncompiled packages they may cause webpack build
// errors. To fix this webpack can be configured to compile to the necessary
import { AppRegistry } from 'react-native';
import App from './app/index.js';
AppRegistry.registerComponent('native_plus_web', () => App);
/**
* Create an ipcortex user, using the create REST call
* @param {string} username - Login username "fred"
* @param {string} name - Full name "Fred Smith"
* @param {string} password - New poassword, should be non empty complex string
* @param {string} host - host to make REST request on
* @param {string} apikey - API key with user create permissions
* @returns {Promise} - resolves or rejects when request completes
*/
function IPCAddUser(username, name, password, host, apikey) {