Skip to content

Instantly share code, notes, and snippets.

View CraigglesO's full-sized avatar
🌎
Sic Parvis Magna

地図の神様 CraigglesO

🌎
Sic Parvis Magna
View GitHub Profile
@CraigglesO
CraigglesO / report.json
Created August 11, 2022 14:19
example oura report
{
"data": [
{
"average_breath": 15.125,
"average_heart_rate": 49.875,
"average_hrv": 66,
"awake_time": 14490,
"bedtime_end": "2022-08-10T02:20:41-04:00",
"bedtime_start": "2022-08-09T14:29:41-04:00",
"day": "2022-08-10",
@CraigglesO
CraigglesO / b2.js
Created February 17, 2022 03:27
PUT signedURL for clients without threat of bad actors
import { AwsClient } from 'aws4fetch'
let b2
// accessKeyId -> B2 keyID
// secretAccessKey -> B2 AppKey
export const prepB2 = (accessKeyId, secretAccessKey) => {
if (!b2) b2 = new AwsClient({ accessKeyId, secretAccessKey, service: 's3' })
}
@CraigglesO
CraigglesO / streets.json
Created November 4, 2021 00:13
Streets style
{
"version": 2,
"name": "s2maps-streets",
"center": [-122.4585607773497, 37.778443127730476],
"zoom": 0,
"minzoom": -1,
"maxzoom": 18.99,
"sources": {
"streets": "s2maps://data/s2maps/streets-v3.s2tiles",
"terrain": "s2maps://data/s2maps/terrain-v1.s2tiles"
@CraigglesO
CraigglesO / solarData.geojson
Created October 20, 2021 13:06
Scraped from a solar project list
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
const SerialPort = require('serialport');
const { asciiToTrytes } = require('@iota/converter')
const Mam = require('@iota/mam');
const port = new SerialPort('/dev/tty.usbserial-210352A82EDB1', {
baudRate: 115200
});
port.on('open', () => {
console.log('port is open!');
@CraigglesO
CraigglesO / find-differences.js
Created July 9, 2018 18:25
Find the differences between images and labels
const fs = require('fs');
const IMAGES = {};
const LABELS = {};
console.log("HERE WE GO");
let folders = fs.readdirSync('./dataset/training/images/19');
// grab all pertaining folders ingoring DS_Store
folders.forEach(folder => {
// A C++ program for Bellman-Ford's single source
// shortest path algorithm.
// nvcc -std=c++11 BellmanFord.cu -D_MWAITXINTRIN_H_INCLUDED -D__STRICT_ANSI__
#include <stdio.h>
#include <climits>
#include <random>
#include <chrono>
#include <ctime>
using namespace std;
@CraigglesO
CraigglesO / sieveOfEratosthenes.rs
Created February 19, 2017 06:11
Sieve of Eratosthenes
use std::io;
use std::num;
fn main () {
// ... use stuff from num library
let mut input = String::new();
let mut a: Vec<bool> = Vec::new();
let mut n: i64 = 0;
println!("Please enter a number");
match io::stdin().read_line(&mut input) {