Skip to content

Instantly share code, notes, and snippets.

View docprofsky's full-sized avatar

✨ Schuyler St. Leger docprofsky

View GitHub Profile

Here is the JavaScript I used to make a bot for ninjanode.

  • Move forward every 3 seconds
    clearInterval(moverId);
    moverId = setInterval(function() {
      ShipSocket.socket.emit('key', {c: "u", s: 1});
      setTimeout(function() {
        ShipSocket.socket.emit('key', {c: "u", s: 0})

}, 500)

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Running the 1.0.0 release jar file
Jan 10, 2016 1:37:48 PM java.util.logging.LogManager$RootLogger log
CONFIG: Configuration done.
platform: /Linux/amd64/
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<video controls autoplay style="width:50%; height:50%;"></video>
<script>
var res = {video:{width:1920, height:1080, frameRate:60}};
navigator.getUserMedia(res, function(localMediaStream){
var video = document.querySelector('video');
# This has all the CMake flags (that I know of) to get CMake to use /opt/local
# as its prefix and link against libraries there. /opt/local is the default
# MacPorts prefix. This also points it to the correct Python install directory
# for Python 2.7 installed with MacPorts.
export prefix=/opt/local
export frameworks_dir=/opt/local/Library/Frameworks
cmake -DPYTHON_EXECUTABLE=$frameworks_dir/Python.framework/Versions/2.7/bin/python2.7 \
$ npm start
> robopaint-build@2.0.0 start /Users/schuyler/development/robopaint/main/build
> grunt build-current-os
Running "build-current-os" task
Running "build-mac" task
Running "electron:macbuild" (electron) task
$ npm i
> serialport@4.0.1 install /Users/schuyler/development/robopaint/main/node_modules/serialport
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download: https://github.com/EmergingTechnologyAdvisors/node-serialport/releases/download/4.0.1/serialport-v4.0.1-electron-v1.0-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for serialport@4.0.1 and electron@1.0.2 (electron-v1.0 ABI) (falling back to source compile with node-gyp)
CXX(target) Release/obj.target/serialport/src/serialport.o
CXX(target) Release/obj.target/serialport/src/serialport_unix.o
CXX(target) Release/obj.target/serialport/src/serialport_poller.o
runtime = electron
disturl = https://atom.io/download/atom-shell
target = 1.0.2
@docprofsky
docprofsky / heliopsis.gvp
Created September 29, 2016 05:09
Gerbv project with good colors for viewing a two layer board (heliopsis)
(gerbv-file-version! "2.0A")
(define-layer! 7 (cons 'filename "heliopsis-B.SilkS.gbo")(cons 'visible #t)(cons 'color #(29491 53970 65535)))
(define-layer! 6 (cons 'filename "heliopsis-B.Mask.gbs")(cons 'visible #t)(cons 'color #(6168 31552 65535)))
(define-layer! 5 (cons 'filename "heliopsis-B.Cu.gbl")(cons 'visible #t)(cons 'color #(0 0 65535)))
(define-layer! 4 (cons 'filename "heliopsis-F.Cu.gtl")(cons 'visible #t)(cons 'color #(65535 0 0)))
(define-layer! 3 (cons 'filename "heliopsis-F.Mask.gts")(cons 'visible #t)(cons 'color #(65535 31465 18972)))
(define-layer! 2 (cons 'filename "heliopsis-F.SilkS.gto")(cons 'visible #t)(cons 'color #(65535 48830 0)))
(define-layer! 1 (cons 'filename "heliopsis.drl")(cons 'visible #t)(cons 'color #(0 65535 0))(cons 'attribs (list (list 'autodetect 'Boolean 1) (list 'zero_supression 'Enum 1) (list 'units 'Enum 0) (list 'digits 'Integer 4))))
(define-layer! 0 (cons 'filename "heliopsis-Edge.Cuts.gm1")(cons 'visible #t)(cons 'color #(32768 65535 32768)))
(define-layer! -1
@docprofsky
docprofsky / io-expander.py
Created November 28, 2016 02:31
GreatFET IO Expander API
from abc import ABCMeta, abstractmethod, abstractproperty
class GreatFETIOExpander(object):
"""Class representing a generic IO expander.
Values for the pin states are integers with the least significant bit
corresponding to pin 0 on the expander.
"""
__metaclass__ = ABCMeta
@abstractproperty