Skip to content

Instantly share code, notes, and snippets.

View test_struct.js
console.log('hello')
import struct from "../struct.mjs";
function toArrayBuffer(buf) {
const ab = new ArrayBuffer(buf.length);
const view = new Uint8Array(ab);
for (let i = 0; i < buf.length; ++i) {
view[i] = buf[i];
}
return ab;
@dwblair
dwblair / postgres_instructions.MD
Last active August 23, 2021 02:37
Setting up postgres in ubuntu
View postgres_instructions.MD

installing postgresql on ubuntu

Install postgres

sudo apt install postgresql postgresql-contrib

Set password for user postgres

View mike_3.ino
#include "HX711.h"
// HX711.DOUT - pin #A1
// HX711.PD_SCK - pin #A0
HX711 scale(A1, A0); // parameter "gain" is ommited; the default value 128 is used by the library
float force_max = 0.;
void setup() {
View bayou_putscript.sh
#!/bin/bash
for i in {1..1000}
do
echo 'post ...'
curl --location --request PUT 'http://159.65.226.222:3000/api/drives/59a0cab6d6faa75e205a52522bcaa255e1d3bcede4b52b85bc899534f6792e4b' --header 'Authorization: 41c29b4d120993dfb0bbc2a0e2f3b63ba0d28a99433a06e9bd3bf025743c62a7' --header 'Content-Type: application/json' --data-raw '{"deviceId":"sensor1","fields":{"temp":20.3, "humid":10}}'
sleep 1
done
View konvivial.md

We are a small collective aiming to connect grassroots movements with academia and everyone who is looking for an alternative way of living. To achieve this goal, we arebegninng by conducting interviews with activists, open and libre innovative organizations ... and anyone with ideas on how to create a better world.

In the future we would like to conduct research motivated intrinsically, following our values to solve problems and without pressure to publish as much as possible -- research of high quality, but pursued without being driven by academic reputation or particular sources of funding. We dream of establishing an institute which is non-hierarchical, open-minded, and focused on peer-learning.

In addition to interviews and research projects, we would also like to focus on teaching and dissemintation -- through workshops, as well as through an online magazine. Our concept for such a magazine invovles short reviews, news, and interviews, as well as longer-form reports and analyses on topics we would li

View putdata.py
import requests
baseurl='http://157.230.188.100:3000/api/drives/'
public_key='c5d1df56d250615bfd3cc547d3bb7313ea1304d280efdefb9f26b268414d141c'
private_key='e18cdb6163d36b3195d17eace02932eba57314809149975fd028053feca86c02'
url = baseurl+public_key
temp = 23
humid = 31
View putscript.sh
#!/bin/bash
curl --location --request PUT 'http://127.0.0.1:3000/api/drives/62cc20d3974887a364a63817ef8a4367c21f5a6b275d1227c6390521e1acc0ca' --header 'Authorization: 15a74c67d6134a40b5d101b17ec6c5943b9a63a70b233979d94804a2bd776ac5' --header 'Content-Type: application/json' --data-raw '{"deviceId":"sensor1","fields":{"temp":28, "humid":18}}'
View k30_ssd1306.ino
/*
Basic Arduino example for K-Series sensor
Created by Jason Berger
Co2meter.com
*/
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
View heltec_lora_deep_sleep.ino
#include <SPI.h>
#include <RH_RF95.h>
#define uS_TO_S_FACTOR 1000000 //Conversion factor for micro seconds to seconds
#define TIME_TO_SLEEP 5 //Time ESP32 will go to sleep (in seconds)
RTC_DATA_ATTR int bootCount = 0;
#define RFM95_CS 18
#define RFM95_RST 14
View heltec_wifi_lora_farmos.ino
#include <WiFi.h>
#include <HTTPClient.h>
#include <ArduinoJson.h>
#include <SPI.h>
#include <RH_RF95.h>
#define RFM95_CS 18
#define RFM95_RST 14
#define RFM95_INT 26