Skip to content

Instantly share code, notes, and snippets.

View Addono's full-sized avatar
🛠️
Solving software problems, one line of code (or long Slack message) at a time

Adriaan Knapen Addono

🛠️
Solving software problems, one line of code (or long Slack message) at a time
View GitHub Profile
@Addono
Addono / Dockerfile
Created March 9, 2023 18:37
Turborepo multi-stage Dockerfile
##############################################################
##### Full dependencies #####
##############################################################
FROM docker.io/library/node:18.14.2-alpine3.16@sha256:72c0b366821377f04d816cd0287360e372cc55782d045e557e2640cb8040d3ea as fulldeps
# Install additional packages
# - libc6-compat for Turbo >1.5.5. See https://github.com/vercel/turbo/issues/2198
# - rsync for efficiently copying a subset of our files into this container
RUN apk add --no-cache libc6-compat rsync
@Addono
Addono / my-queue.service.ts
Created February 5, 2023 12:24
Global static singleton jobs in Nest.js with Bull
import { Injectable, OnModuleInit } from "@nestjs/common";
const QUEUE_NAME = "my-job-queue";
const STATIC_CRON_JOB_NAME = "static-schedule";
export interface MyQueueJob {}
@Injectable()
export class MyQueueService implements OnModuleInit {
constructor(
@Addono
Addono / gist:a3d4c0ccfcae50eb572ad80838d847cd
Created August 17, 2022 09:37
PL3461WQ ResX Configuration - MacBook Pro 2019 - Official Apple USB-C adapter
PowerStrip timing parameters:
3440x1440=3440,48,32,80,1440,3,10,26,298063,5
Generic timing details for 3440x1440:
HFP=48 HSW=32 HBP=80 kHz=82 VFP=3 VSW=10 VBP=26 Hz=55
VESA detailed timing details:
PClk=298.06 H.Active=3440 H.Blank=160 H.Offset=32 HSW=32 V.Active=1440 V.Blank=39 V.Offset=3 VSW=10
# XFree86 modeline parameters:
@Addono
Addono / command.sh
Last active August 11, 2022 08:07
Check for outdated resources in Kubernetes cluster
#
# Checks for all resources in a Kubernetes cluster whether they are
# deprecated or removed in a future version.
#
# For available versions of Pluto, see:
# https://quay.io/repository/fairwinds/pluto?tab=tags
#
TARGET_K8S_VERSION="v1.23.8"
kubectl get all --output yaml --all-namespaces | docker run --rm quay.io/fairwinds/pluto:v5.10 detect - -t k8s=$TARGET_K8S_VERSION
@Addono
Addono / sendEmail.ts
Created May 27, 2021 19:33
NextJS HubSpot Form Submission API Endpoint
import type { NextApiRequest, NextApiResponse } from "next"
import axios from "axios"
const HUBSPOT_API_KEY = process.env.HUBSPOT_API_KEY
const HUBSPOT_PORTAL_ID = "62515" // Replace this
const HUBSPOT_FORM_GUID = "fcc69886-915b-4fef-b35f-27850ef461e1" // Replace this
type Response = {
success: boolean
email?: string
@Addono
Addono / EmailSignupForm.tsx
Last active May 27, 2021 19:32
NextJS HubSpot Email Collection Form
import { useEffect, useState } from "react"
import useAxios from "axios-hooks"
const EmailSignupForm = () => {
const [email, setEmail] = useState("")
const [pageUri, setPageUri] = useState<string>()
const [{ data, loading, error }, refetch] = useAxios(
{
url: "/api/emailSignup",
@Addono
Addono / app.js
Created April 18, 2021 08:01
ClaimR React Native app example
import React from 'react'
import { StyleSheet, View, Text, Button } from 'react-native'
import { ClaimrClient, useLazyVerifiedLocation } from '@claimr/react-native-client'
const client = new ClaimrClient({ apiKey: 'YOUR_API_KEY' })
const App = () => {
const { claim, state, submit } = useLazyVerifiedLocation({ client })
@Addono
Addono / docker-compose.yml
Created February 8, 2021 17:39
Docker Compose file for local Jupter notebook development
version: "3.1"
services:
jupyter:
image: jupyter/scipy-notebook
volumes:
- ./:/home/jovyan
ports:
- 8888:8888
environment:
#
# Header Description:
#
# Version: v2.0.0.1
#
# Raw,ElapsedRealtimeMillis,TimeNanos,LeapSecond,TimeUncertaintyNanos,FullBiasNanos,BiasNanos,BiasUncertaintyNanos,DriftNanosPerSecond,DriftUncertaintyNanosPerSecond,HardwareClockDiscontinuityCount,Svid,TimeOffsetNanos,State,ReceivedSvTimeNanos,ReceivedSvTimeUncertaintyNanos,Cn0DbHz,PseudorangeRateMetersPerSecond,PseudorangeRateUncertaintyMetersPerSecond,AccumulatedDeltaRangeState,AccumulatedDeltaRangeMeters,AccumulatedDeltaRangeUncertaintyMeters,CarrierFrequencyHz,CarrierCycles,CarrierPhase,CarrierPhaseUncertainty,MultipathIndicator,SnrInDb,ConstellationType,AgcDb,CarrierFrequencyHz
#
Raw,1495260698,696809000000,,,-1246808233190696589,0.0,4.857103093679639,,,0,1,0.0,16431,316129931564615,11,40.876319885253906,-85.53832074583623,0.0016427808441221714,17,-81583.78418521381,8.213904220610857E-4,1.57542003E9,,,,0,,1,52.750877380371094,1.57542003E9
Raw,1495260698,696809000000,,,-1246808233190696589,0.0,4.857103093679639,,,0,3,0.0,16431,316129923668613,27,29.818252
@Addono
Addono / docusaurus.config.js
Created October 10, 2020 13:30
Updated Docusaurus configuration
module.exports = {
// ...
// plugins: [path.resolve(__dirname, 'plugins', 'goatcounter')],
plugins: ['docusaurus-plugin-goatcounter'],
};