Skip to content

Instantly share code, notes, and snippets.

View danopia's full-sized avatar

Daniel Lamando danopia

View GitHub Profile
@danopia
danopia / Dockerfile
Last active May 2, 2024 18:30
ERCOT Frozen Grid 2021 - Metrics Reporters
FROM hayd/alpine-deno:1.10.1
WORKDIR /src/app
ADD deps.ts ./
RUN ["deno", "cache", "deps.ts"]
ADD *.ts ./
RUN ["deno", "cache", "mod.ts"]
ENTRYPOINT ["deno", "run", "--unstable", "--allow-net", "--allow-hrtime", "--allow-env", "--cached-only", "--no-check", "mod.ts"]
@danopia
danopia / 1_floating.go
Last active December 1, 2023 03:20
examples of adding a title to olekukonko/tablewriter in post
package main
import (
"fmt"
"strings"
"github.com/google/uuid"
"github.com/olekukonko/tablewriter"
)
@danopia
danopia / solar.js
Created April 8, 2019 16:51
JavaScript file to calculate the sun's position for given Earth coordinates + Date object
/* solar.js -- Solar position ported source
This file was a part of Redshift.
Redshift is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Redshift is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@danopia
danopia / database.yml
Created April 25, 2011 04:19
Default SQLite database.yml
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
@danopia
danopia / about.md
Created December 28, 2011 11:30
Cards Against Humanity playing cards

Cards Against Humanity

Below are the white and black card sets published by Cards Against Humanity. Take them and come back with a bot. You have 48 hours, starting from an arbitrary time that I forget.

Black cards with 2 blanks are pick 2. Black cards with 3 blanks are pick 3, draw 2.

The rules are on the official web site.

These cards are taken from this PDF.

import { Server } from "https://deno.land/std@0.200.0/http/server.ts";
const port = 4505;
const handler = (request: Request) => {
const body = `Your user-agent is:\n\n${request.headers.get(
"user-agent",
) ?? "Unknown"}`;
return new Response(body, { status: 200 });
};
const server = new Server({ host: '0.0.0.0', port, handler });
const certFile = "cert.pem";
import * as ows from "https://deno.land/x/stream_observables@v1.3/mod.ts";
import { trace, SpanKind, propagation, context, TextMapGetter, ROOT_CONTEXT, SpanContext } from "https://deno.land/x/observability@v0.4.0/opentelemetry/api.js";
type KvRealtimeEvent =
| {
type: 'insert' | 'replace';
appliedAt: Date;
key: Deno.KvKey;
value: unknown;
versionstamp: string;
#include "LinkedList.h"
template <class T>
LinkedList<T>::LinkedList()
{
first = NULL;
last = NULL;
}
template <class T>
@danopia
danopia / best-500-albums.jsonl
Last active February 16, 2023 13:10
Extracted listing for "Best 500 Albums Of All Time" published Sept 2020
{"position":500,"title":"Funeral","artist":"Arcade Fire","year":"2004","label":"MERGE"}
{"position":499,"title":"Ask Rufus","artist":"Rufus, Chaka Khan","year":"1977","label":"ABC"}
{"position":498,"title":"Suicide","artist":"Suicide","year":"1977","label":"RED STAR"}
{"position":497,"title":"The Indestructible Beat of Soweto","artist":"Various Artists","year":"1985","label":"EARTHWORKS"}
{"position":496,"title":"Dónde Están los Ladrones","artist":"Shakira","year":"1998","label":"COLUMBIA"}
{"position":495,"title":"II","artist":"Boyz II Men","year":"1991","label":"MOTOWN"}
{"position":494,"title":"Presenting the Fabulous Ronettes","artist":"The Ronettes","year":"1964","label":"PHILLES"}
{"position":493,"title":"Here, My Dear","artist":"Marvin Gaye","year":"1978","label":"TAMLA/MOTOWN"}
{"position":492,"title":"Nick of Time","artist":"Bonnie Raitt","year":"1989","label":"CAPITOL"}
{"position":491,"title":"Fine Line","artist":"Harry Styles","year":"2019","label":"COLUMBIA"}
! 2021-11-26 lets make stuff work
! page autotranslate
@@||translate.google.com/gen204
! datadog RUM
@@||rum-http-intake.logs.datadoghq.eu^$ping
! google analytics
@@||www.google-analytics.com^