Skip to content

Instantly share code, notes, and snippets.

@lynnaloo
lynnaloo / gist:2bac083b97c4d3eb99c06cf39d0aaf2e
Created November 17, 2021 15:50
Canvas + Custom Vision
module.exports = async function (context, req) {
context.log('JavaScript HTTP trigger function processed a request.');
const { createCanvas, loadImage } = require('canvas');
const fs = require('fs');
const rawImage = req.body.image;
const w = rawImage.width;
const h = rawImage.height;
console.log(w, h);
@lynnaloo
lynnaloo / nodebots-install.sh
Last active July 10, 2018 00:24
NodeBots Development Environment Install Script
#!/bin/bash
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y ppa:webupd8team/atom
sudo apt-get update -y
sudo apt-get install -y -qq git curl vim bluetooth
sudo apt-get install -y -qq libbluetooth-dev build-essential openssh-client bluez
sudo apt-get install -y atom
curl -L https://git.io/n-install | bash -s -- -y
. /home/admin/.bashrc
# update to versions compatible with Johnny-Five
@lynnaloo
lynnaloo / stevegist
Created February 21, 2017 00:31
Steve's Gist
var fs = require('fs');
if (process.argv.length <= 2) {
console.log("Usage: " + __filename + " path/to/directory");
@lynnaloo
lynnaloo / autopilot.js
Last active February 23, 2016 16:47
Autopilot script for the Parrot Rolling Spider Minidrone
'use strict';
var Drone = require('rolling-spider');
var temporal = require('temporal');
var d = new Drone(process.env.UUID);
d.connect(function () {
d.setup(function () {
d.flatTrim();
d.startPing();
@lynnaloo
lynnaloo / spark-sumo.js
Last active August 29, 2015 14:18
Spark Sumo + Mode
var keypress = require("keypress");
var Spark = require("spark-io");
var five = require("johnny-five");
var Sumobot = require("sumobot")(five);
var dotenv = require('dotenv');
// load the spark token and device id from .env file
dotenv.load();
keypress(process.stdin);
@lynnaloo
lynnaloo / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lynnaloo
lynnaloo / meetup.js
Created July 23, 2014 15:18 — forked from qwo/meetup.js
/* Simple Way to Raffle things off from Meetup*/
var meetup = $(".member-name");
$(meetup[Math.floor(Math.random() * meetup.length)]).text().trim();
@lynnaloo
lynnaloo / gist:acb71d5e870187acc020
Created May 7, 2014 18:44
Vagrant /etc/ssh/sshd_config
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no
# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes
@lynnaloo
lynnaloo / gist:10476429
Last active August 29, 2015 13:59
xTuple Node Server Init
#####
# xTuple
#
# The xTuple-node process allows mobile connections
#
# Ubuntu UpStart service job
# Should install to /etc/init and be named xtuple.conf
# Usage: service xtuple (start | stop | status)
description "xTuple Node Server"