Skip to content

Instantly share code, notes, and snippets.

Building product, looking for consulting work

Chris Sattinger crucialfelix

Building product, looking for consulting work
View GitHub Profile
crucialfelix / 2023-01-13
Last active Jan 24, 2023
Get Chrome history for a single day and create a markdown file summarizing browsing activity
View 2023-01-13
# [[2023-01-13]] log
## URLs
- <strong></strong>
- [Prime Video - Video on Demand - Online-Videothek: Filme und Serien online ansehen oder als Einzelabruf online leihen oder kaufen]( /Amazon-Video/b/
- <strong></strong>
- [Parwal vs Kundru | कुंदरु या परवल | Pointed Gourd Vs Ivy Gourd | Everyday Life # 267 - YouTube]( /watch
- [YouTube]( /
crucialfelix /
Created Jul 8, 2022
climatebase signup error bug report
View deno-export-markdown-posts.ts
#!/usr/bin/env deno run
* Copy markdown posts from org folders to publishing folder
* Usage:
* deno run --allow-read --allow-write deno-export-markdown-posts.ts ~/org/blogging/mattermind/ ~/github/
import { join } from "";
View react-query-optimistic-update.ts
import _ from "lodash";
import { QueryClient } from "react-query";
* optimisticUpdate
* A utility function to update the react-query cache with data during
* a mutation.
* This clones the current data, uses the supplied function to update that
"""Check all required network connections
This can be called in AWS or in local docker-compose to check
that all settings work for connecting to database, memcached and rabbit.
exits with error unless all connections are OK
import os
import socket
import subprocess
import sys
crucialfelix / analytics.js
Last active Nov 30, 2022
Google Analytics for Next.js with next/router
View analytics.js
* analytics.js;
* Copyright 2019 Chris Sattinger
* MIT license - do as thou wilt
* This will send page views on route change to Google Analytics.
* Works with and
import Router from "next/router";
import re
from django.db import models
from graphene.relay import PageInfo
from graphene_django.fields import DjangoConnectionField
from graphql_relay.connection.arrayconnection import cursor_to_offset, offset_to_cursor
class SimplifiedDjangoConnectionField(DjangoConnectionField):
"""A simplified extension of DjangoConnectionField
crucialfelix / scanner.ts
Created Jul 23, 2018
Scan a directory of music files (mp3 aif wav flac etc.) and collect data grouped by artist, release, tracks
View scanner.ts
import readdir from 'fs-readdir-recursive';
import { List } from 'linqts';
import _ from 'lodash';
import { IAudioMetadata, parseFile } from 'music-metadata';
import path from 'path';
type Common = IAudioMetadata["common"];
export interface Track {
path: string;
View 1-Messages.tsx
import React from "react";
import { MessagesQuery, MessagesQueryVariables } from "../../queries";
import { graphql, QueryProps } from "react-apollo";
import Message from "./Message";
// IMPORTANT: The query is required, not imported.
const query = require("./Messages.graphql");
const POLL_INTERVAL = 7901;
View Messages.graphql
#import './Message.graphql'
query Messages($threadKey: String!) {
viewer {
messages(threadKey: $threadKey) {
edges {
node {