Skip to content

Instantly share code, notes, and snippets.

M-Jet Supersprint for Dummies

title

This page provides a few details that will help you build an M-Jet Supersprint 3D Printed RC Jetboat. When you purchase the 3D model files, there is an excellent guide. The aim of this page is not to replace that guide, but rather to supplement it with a few details that make life easier for those coming into the RC hobby for the first time, or who simply want to get going quickly.

@jasonwaters
jasonwaters / target-nodejs-sdk-ipaddress-demo.js
Last active June 9, 2020 00:31
This is an example of how to specify an ipAddress when making a getOffers method call. Simply add it to the geo object of the request context.
const TargetClient = require("@adobe/target-nodejs-sdk");
const client = TargetClient.create({
client: "adobesummit2018",
organizationId: "65453EA95A70434F0A495D34@AdobeOrg"
});
client
.getOffers({
request: {
@jasonwaters
jasonwaters / sorted-insert-binary-search.js
Created June 14, 2019 02:14
insert elements into an array, keeping it sorted.
function binarySearch(arr, target, left, right, closest=-1) {
if(arr.length <=0) return 0;
const mid = Math.floor((left+right)/2);
closest = arr[mid] < target ? mid+1 : mid;
if(left < right) {
if(arr[mid] < target) {
return binarySearch(arr, target, mid+1, right, closest);
@jasonwaters
jasonwaters / count-array-dupes-sorted.js
Created June 13, 2019 23:25
Count the number of repeat integers in a sorted array.
function first(arr, target, left, right, found=-1) {
const mid = Math.floor((left+right)/2);
found = arr[mid] === target ? mid : found;
if(right > left) {
if(arr[mid] >= target) {
return first(arr, target, left, mid-1, found);
}else if(arr[mid] < target) {
return first(arr, target, mid+1, right, found);
}
@jasonwaters
jasonwaters / Delete Columns to Make Sorted.js
Created June 12, 2019 21:07
Delete Columns to Make Sorted
// https://leetcode.com/problems/delete-columns-to-make-sorted/description/
function minDels(arr) {
let count = 0;
const numCols = arr[0].length;
for(let x=numCols-1;x>=0;x--) {
for(let y=1;y<arr.length;y++) {
if(arr[y][x] < arr[y-1][x]) {
count++;
@jasonwaters
jasonwaters / multiplify.js
Created May 17, 2019 18:34
Return an Array of integers by multiplying all elements in given array except the current index integer.
const a = [1,2,3, 2];
 
function multiplify(arr) {
const total = arr.reduce((acc, item) => {
return acc * item;
}, 1);
return arr.map((el) => total/el)
@jasonwaters
jasonwaters / move-non-zero-array.js
Created May 17, 2019 18:31
Move non-zeroes to the left of an array.
const a = [2,3,0,0,0,0,0,2,3,4,0,2,0,3,0,1,8];
function leftify(arr) {
let leftmost = 0;
arr.forEach((el, idx) => {
if(el !== 0) {
const elements = arr.splice(idx,1);
arr.splice(leftmost,0,...elements);
leftmost++;
@jasonwaters
jasonwaters / karabiner-rules.json
Last active August 2, 2022 08:09
Remap the home and end keys in macOS using Karabiner Elements
{
"rules": [
{
"description": "change home key to command + left_arrow",
"manipulators": [
{
"from": {
"key_code": "home"
},
"to": [
@jasonwaters
jasonwaters / blossom.js
Last active March 23, 2017 18:54
blossom advanced schedule ideas
// right now i just get /weekly-recurring-blackouts/
// which returns an array of [12] arrays. Each sub array an array with 7 truthy values representing true if blacked out, false if scheduled
let blackout_response = [
[false, true, false, true, false, true, true],
[false, true, false, true, false, true, true],
[false, true, false, true, false, true, true],
[false, true, false, true, false, true, true],
[false, true, false, true, false, true, true],
function powerset(arr) {
let sets = [[]];
arr.forEach(value => {
sets.forEach(set => {
sets.push(set.concat(value));
});
});
return sets;
}