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
// Listen for fence events. | |
Perimeter.addListener("FenceEvent", (event: FenceEvent`) => { | |
console.log(event.fences[0].name); | |
}); | |
// Create a fence. | |
let newFence : Fence = { | |
name : "Empire State Building", | |
uid : "123456789", | |
payload: "Here is some data for later.", |
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
class MinHeap(T) | |
# Actual heap | |
@elements = Array(T).new | |
# Map of Objects -> Locations | |
@locs = Hash(T, Int32).new | |
# Look at the top of the heap without removing the element. | |
def peek? : T | Nil | |
empty? ? nil : @elements.first | |
end |
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
import _Vue from 'vue'; | |
export namespace StateService | |
{ | |
export const StorePlugin = { | |
install(Vue : typeof _Vue, options : { stateModel : any }) | |
{ | |
let store = new Store(); |
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 = almy; | |
declare const almy: { | |
almy: { | |
/** | |
* Re-initializes the state store. | |
* @returns None | |
*/ | |
create(): void; |
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
{ | |
"captainVersion": "2", | |
"documentation": "Taken from https://github.com/directus/docker.", | |
"dockerCompose": { | |
"version": "7", | |
"services": { | |
"$$cap_appname-db": { | |
"image": "mysql:5.7", | |
"notExposeAsWebApp": "true", | |
"volumes": [ |
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
FROM openjdk:8-jre-slim | |
ENV VERSION 0.33.2 | |
WORKDIR /app | |
ADD https://raw.githubusercontent.com/metabase/metabase/v$VERSION/bin/start /app/bin/ | |
ADD http://downloads.metabase.com/v$VERSION/metabase.jar /app/target/uberjar/ | |
EXPOSE 3000 |
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
{ | |
"captainVersion": "2", | |
"documentation": "Taken from https://hub.docker.com/r/agentejo/cockpit/", | |
"dockerCompose": { | |
"version": "7", | |
"services": { | |
"$$cap_appname": { | |
"image": "agentejo/cockpit", | |
"restart": "always", |
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
import PID, time, math | |
class FlightVector(object): | |
x = 0 | |
y = 0 | |
z = 0 | |
def __init__(self, x, y, z): | |
self.x = float(x) | |
self.y = float(y) |
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
import time | |
from dronekit import VehicleMode, connect | |
import os | |
from PID import PID | |
vehicle = connect("/dev/serial/by-id/usb-3D_Robotics_PX4_FMU_v2.x_0-if00") | |
# vehicle = connect("tcp:127.0.0.1:5760") | |
MAX_THROTTLE = vehicle.parameters['RC3_MAX'] | |
MIN_THROTTLE = vehicle.parameters['RC3_MIN'] |