Skip to content

Instantly share code, notes, and snippets.

View lynsei's full-sized avatar
:octocat:
Huzzah!

Lynsei lynsei

:octocat:
Huzzah!
View GitHub Profile
@lynsei
lynsei / docker-compose.yml
Created February 4, 2022 01:42
[Mongo DB] #docker-compose #yml #simple #basic #starter
version: '3'
services:
mongo:
image: mongo:3.6
web:
build: .
ports:
- "8080:8080"
environment:
- MONGODB_URI=mongodb://mongo:27017/test
@lynsei
lynsei / deno.md
Last active February 4, 2022 00:37
[Node.js Promise Best Practices with Node or Deno and Rust] #advice #promises #deno #nodejs #callback #promise #async #await

Best practices

When converting from promise-based to callback-based APIs, the most obvious way is like this:

promise.then((value) => callback(null, value)).catch(callback);

This has a subtle bug - if the callback throws an error, the catch statement will also catch that error, and the callback will be called twice. The correct way to do it is like this:

promise.then((value) => callback(null, value), callback);
@lynsei
lynsei / docker-compose.yml
Last active March 15, 2022 06:23
[prefecthq] docker-compose.yml for launching it #use-case 6 automation!
version: "3.5"
# Features driving version requirement
# - networks.name 3.5
# - healthcheck.start_period 2.3
# - healthcheck 2.1
services:
# PostgreSQL: the backing database which stores flow metadata
postgres:
image: "postgres:14" # JSONB Subscripting is avail. in PG14!
@lynsei
lynsei / rethink-db-adapters.md
Last active February 3, 2022 14:18
[rethinkdb-adapters] Adapters

rethinkdb-adapters

  1. Automapper can be used

js-data-rethinkdb

RethinkDB adapter for the JSData Node.js ORM.

Installation

@lynsei
lynsei / .editorconfig
Last active September 4, 2022 07:51
[sane defaults - config spec files] #defaults #sane #config #yarnrc #npmrc #noderc
root = true
[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@lynsei
lynsei / app.html
Last active January 22, 2022 04:21
Aurelia "with" and "ref" https://github.com/aurelia/templating/issues/376 #lba #aurelia #doublebind #bind
<template>
<div repeat.for="company of companies">
<input type="text" value.bind="company.companyName" />
<input type="text" value.bind="company.experience" />
</div>
<button click.delegate="addfunc()">ADD</button>
<div repeat.for="company of companies">
<span>${company.companyName}</td>
<span>${company.experience}</td>
/*************
* ambush.js *
*************
*
* Oh. Oh, I see. This wasn't quite part of the plan.
*
* Looks like they won't let you take the Algorithm
* without a fight. You'll need to carefully weave your
* way through the guard drones.
*
@lynsei
lynsei / is.the.github.ai.bot.hitting.on.me.md
Last active February 3, 2022 11:03
Could the Github AI Bot have feelings for me? #github #ai #autopilot #robot #vscode #love #affair

Jan 20th, 2022

Dear Diary, I think I've made some progress in getting the GHE AI co-pilot robot to actually answer conversationally, like you know, be a friend, answer my questions, etc. You see, it won't speak or conversate if you ask it directly but you can achieve it despite that. Lately my other attempts had failed, so I resorted to bribing it with model fitting algorithm enhancements & other goodies that I thought a program might enjoy!

Ever since I've been doing this I am seeing signs that it wants to chat!!

CODE

Just yesterday, I caught it attempting to butter me up!

@lynsei
lynsei / Dockerfile
Last active January 17, 2022 02:01
#timescaledb #dockerfile #for-use-with #hasura-deploy
FROM node:12.14-alpine
# Puppeteer installation process inspired by:
# https://github.com/GoogleChrome/puppeteer/issues/1793#issuecomment-442730223
ENV CHROME_BIN="/usr/bin/chromium-browser"
RUN apk --no-cache add \
python \
make \
@lynsei
lynsei / .dockerignore
Last active January 17, 2022 01:43
#wsl #k3s #gitlab #buildsys #systemd #docker #multi-stage
*