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
#include <iostream> | |
template <std::size_t N, typename T> | |
inline static T | |
divmod (T & val) noexcept | |
{ | |
T rest = val; | |
val /= N; | |
return rest % N; | |
} |
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
from math import radians, degrees, atan2, sin, cos | |
class GpsPoint: | |
lat: float | |
lon: float | |
def __init__(self, lat: float, lon: float): | |
self.lat = lat | |
self.lon = lon |
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
// vim: ts=3 sw=3 | |
use axum::{ | |
extract::State, | |
response::IntoResponse, | |
routing::{get, post}, | |
Json, Router, | |
}; | |
use serde_derive::{Deserialize, Serialize}; | |
use std::collections::BTreeMap; | |
use std::env; |
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
// vim: ts=3 sw=3 | |
use axum::{ | |
extract::State, | |
response::IntoResponse, | |
routing::{get, post}, | |
Json, Router, | |
}; | |
use serde_derive::{Deserialize, Serialize}; | |
use std::collections::BTreeMap; | |
use std::env; |
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
#include "codec/blink/Types.h" | |
#include "doctest/doctest.h" | |
#include <vector> | |
namespace Sequitor::Blink::Utest | |
{ | |
// Bill/2 -> u32 Amount, u32 Tip? | |
struct Bill : Obj<Bill> | |
{ | |
u32 getAmount () const { return amount.value; } |
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
#pragma once | |
namespace Sequitor::Blink | |
{ | |
//! Blink native | |
//! | |
//! | 32-bit length | 64-bit type id | 32-bit extension offset | fields... | | |
//! | |
//! * Dynamically sized data values are allocated in a data area after the | |
//! fixed width fields, the inline value becomes a relative offset to the |
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
[Unit] | |
Description=step-ca service | |
Documentation=https://smallstep.com/docs/step-ca | |
Documentation=https://smallstep.com/docs/step-ca/certificate-authority-server-production | |
After=network-online.target | |
Wants=network-online.target | |
StartLimitIntervalSec=30 | |
StartLimitBurst=3 | |
ConditionFileNotEmpty=/etc/step-ca/config/ca.json | |
ConditionFileNotEmpty=/etc/step-ca/password.txt |
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
--- | |
- name: "Install required packages" | |
tags: | |
- ca | |
- smallstep | |
apt: name={{ item }} state=present | |
with_items: | |
- haveged | |
- ufw |
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
#!/bin/bash | |
set -e | |
echo -n "user: " | |
read user | |
echo ${user} | |
mkdir -p keys |
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 { DB } from "https://deno.land/x/sqlite/mod.ts"; | |
class Config { | |
constructor(dbName: string) { | |
this.dbName = dbName; | |
const db = new DB(this.dbName); | |
db.query(` | |
CREATE TABLE IF NOT EXISTS config ( | |
key STRING PRIMARY KEY, |
NewerOlder