This file contains hidden or 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
| package main | |
| import ( | |
| "context" | |
| "errors" | |
| "fmt" | |
| "log" | |
| "os" | |
| "os/exec" | |
| "syscall" |
This file contains hidden or 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
| package main | |
| import ( | |
| "github.com/kardianos/service" | |
| "log" | |
| "flag" | |
| ) | |
| type Service struct {} |
This file contains hidden or 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
| // GIST to outline driving this very cost effective serial servos directly from Particle Photons | |
| // Turns out the servo uses half duplex, and requires an Open Drain | |
| // Turn off echo, or we can't read. | |
| // According to my nScope although the docs say pull-up to 5V I can see it's a 3.3V that's 5V tolerant | |
| // ... just like the photon... | |
| // So, anyway, 3.3V works just fine. Link to the TX pin (that's Serial1). RX pin is unused. | |
| // I used an external 10K pull-up to the 3.3V pin on the photon. You might be able to do this internally too? | |
| // | |
| // Power the servo separately to > 6V, so be a little careful with your wiring (cos the servo power will fry your serial pin) |
This file contains hidden or 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
| function doGet(request) { | |
| if (request.parameters.url != undefined && request.parameters.url != "") { | |
| var imageBlob = UrlFetchApp.fetch(request.parameters.url).getBlob(); | |
| var resource = { | |
| title: imageBlob.getName(), | |
| mimeType: imageBlob.getContentType() | |
| }; | |
| var options = { | |
| ocr: true | |
| }; |
This file contains hidden or 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
| using System; | |
| using System.Runtime.InteropServices; | |
| using System.ComponentModel; | |
| namespace GetLastUserInput | |
| { | |
| public class GetLastUserInput | |
| { | |
| private struct LASTINPUTINFO | |
| { |
This file contains hidden or 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
| package com.comphenix.example; | |
| import java.nio.ByteBuffer; | |
| import java.nio.IntBuffer; | |
| import org.bukkit.Location; | |
| import org.bukkit.World; | |
| /** | |
| * Utility class for creating arrays of block changes. |
This file contains hidden or 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
| package com.comphenix.example; | |
| import org.bukkit.Location; | |
| import org.bukkit.command.Command; | |
| import org.bukkit.command.CommandSender; | |
| import org.bukkit.entity.Player; | |
| import org.bukkit.plugin.java.JavaPlugin; | |
| public class PlayServerMultiBlockChange extends JavaPlugin { | |
| @Override |
This file contains hidden or 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 math | |
| lengthRearArm = 135.0 | |
| lengthForearm = 160.0 | |
| # Distance from joint3 to the center of the tool mounted on the end effector. | |
| distanceTool = 50.9 | |
| heightFromBase = 80.0 + 23.0 | |
| maxDistance = lengthRearArm + lengthForearm |
This file contains hidden or 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 serial | |
| import time | |
| import struct | |
| import threading | |
| import signal | |
| class Dobot: | |
| def __init__(self, port, baud=230400): | |
| self.port = serial.Serial(port, baudrate=baud) | |
| self.running = False |