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
package main | |
import ( | |
"context" | |
"flag" | |
"fmt" | |
"log" | |
"os" | |
"os/signal" | |
"syscall" |
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
package main | |
import ( | |
"bytes" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" |
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
#include <avr/sleep.h> | |
const int timerOutPin = 11; | |
#define analogOutMax 235 | |
void timer() { | |
unsigned long startTime = millis(); | |
long elapsedTime = 0; | |
int outputValue = 0; |
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
package hoge | |
import ( | |
"bytes" | |
"context" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"os" |
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
#cloud-config | |
#see: https://cloud.google.com/container-optimized-os/docs/how-to/create-configure-instance | |
write_files: | |
- path: /etc/systemd/system/influxdb.service | |
permissions: 0644 | |
owner: root | |
content: | | |
[Unit] | |
Description=Start influxdb docker container |
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
#!/bin/sh | |
set -e | |
VERSION=$(curl -s https://api.github.com/repos/jenkins-x/jx/releases/latest | jq '.tag_name' -r) | |
curl -sL https://github.com/jenkins-x/jx/releases/download/$VERSION/jx-linux-amd64.tar.gz | tar xzv | |
sudo mv jx /usr/local/bin |
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
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/google/gousb" | |
"github.com/google/gousb/usbid" | |
) |
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
package calc | |
import ( | |
"go/token" | |
"go/types" | |
) | |
func Compute(expr string) (string, error) { | |
tv, err := types.Eval(token.NewFileSet(), types.NewPackage("main", "main"), token.NoPos, expr) | |
if err != nil { |
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
package mqtt_test | |
import ( | |
"sync" | |
"testing" | |
mqtt "github.com/eclipse/paho.mqtt.golang" | |
) | |
func TestMqttPubSub(t *testing.T) { |