Render a list of items using AlpineJS
A Pen by Eddie Ebeling on CodePen.
#include <tuple> | |
#include <cassert> | |
template<typename T> | |
T map_range(T s, const std::pair<T,T>& in, const std::pair<T,T>& out) | |
{ | |
auto [in_min, in_max] = in; | |
auto [out_min, out_max] = out; | |
assert(in_min <= s && s <= in_max); | |
return out_min + (s - in_min) * (out_max - out_min) / (in_max - in_min); |
mod vecmath { | |
use std::ops::{Add, Div, Mul, Sub}; | |
#[derive(Debug, Copy, Clone)] | |
pub struct Vec3 { | |
pub x: f64, | |
pub y: f64, | |
pub z: f64 | |
} | |
import requests | |
import math | |
import os | |
import argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("--lat", type=float, required=True) | |
parser.add_argument("--lon", type=float, required=True) | |
parser.add_argument("--zoom", type=int, required=True) |
#pragma once | |
#include <cmath> | |
namespace q { | |
template <typename T> | |
struct vec3 { | |
union { | |
struct { T x, y, z; }; |
Render a list of items using AlpineJS
A Pen by Eddie Ebeling on CodePen.
import NextAuth from "next-auth"; | |
import GoogleProvider from "next-auth/providers/google"; | |
import PostgresAdapter from "../../../lib/adapter"; | |
const pool = new Pool({ | |
user: "postgres", | |
host: "localhost", | |
database: "postgres", | |
password: "postgres", | |
port: 5432, |
// ==UserScript== | |
// @name Redirect from mobile wikipedia | |
// @namespace http://tampermonkey.net/ | |
// @version 1.3 | |
// @description Redirect wikipedia mobile pages to desktop pages | |
// @author Jakob Maier | |
// @match https://*.m.wikipedia.org/* | |
// @icon https://www.google.com/s2/favicons?domain=wikipedia.org | |
// @updateURL https://gist.githubusercontent.com/gue-ni/7de602dc5af933b2c47b6db5f4370ac8/raw/redirect_from_mobile_wikipedia.js | |
// @downloadURL https://gist.githubusercontent.com/gue-ni/7de602dc5af933b2c47b6db5f4370ac8/raw/redirect_from_mobile_wikipedia.js |
// ==UserScript== | |
// @name Color hackernews links | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description try to take over the world! | |
// @author You | |
// @match https://news.ycombinator.com/ | |
// @icon https://www.google.com/s2/favicons?domain=ycombinator.com | |
// @grant GM_addStyle | |
// ==/UserScript== |
// ==UserScript== | |
// @name Der Standard AdBlock | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Easy way to block ads on derstandard.com | |
// @author Jakob Maier | |
// @match https://www.derstandard.at/* | |
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw== | |
// @grant none | |
// ==/UserScript== |
version: "3" | |
services: | |
db: | |
image: postgres | |
restart: always | |
ports: | |
- 5432:5432 | |
environment: | |
POSTGRES_USER: postgres # default is postgres, same as POSTGRES_DB |