Skip to content

Instantly share code, notes, and snippets.

View sinclairnick's full-sized avatar
🪺
Cooking

Nick Sinclair sinclairnick

🪺
Cooking
  • New Zealand
  • 10:44 (UTC +12:00)
View GitHub Profile
@msurdi
msurdi / prisma-session-store.js
Last active September 21, 2022 06:13
Prisma express session store
import { Store } from "express-session";
class PrismaSessionStore extends Store {
/**
*
* @param {import("@prisma/client").PrismaClient} db
*/
constructor(db, { cleanupInterval } = {}) {
super();
this.db = db;
@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active June 10, 2025 02:07
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

@coryodaniel
coryodaniel / list.txt
Created May 13, 2020 22:04
GCP List of API Services
NAME TITLE
abusiveexperiencereport.googleapis.com Abusive Experience Report API
acceleratedmobilepageurl.googleapis.com Accelerated Mobile Pages (AMP) URL API
accessapproval.googleapis.com Access Approval API
accesscontextmanager.googleapis.com Access Context Manager API
actions.googleapis.com Actions API
adexchangebuyer-json.googleapis.com Ad Exchange Buyer API
adexchangebuyer.googleapis.com Ad Exchange Buyer API II
adexchangeseller.googleapis.com Ad Exchange Seller API
adexperiencereport.googleapis.com Ad Experience Report API
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active June 19, 2025 07:19
Online Resources For Web Developers (No Downloading)
@udibr
udibr / keras_part_load.py
Last active May 9, 2020 23:12
Load weights to Keras model from file allowing for differences between file and model
import numpy as np
import h5py
import keras.backend as K
def str_shape(x):
return 'x'.join(map(str, x.shape))
def load_weights(model, filepath, lookup={}, ignore=[], transform=None, verbose=True):
"""Modified version of keras load_weights that loads as much as it can.
Useful for transfer learning.
@p3t3r67x0
p3t3r67x0 / prefixed-office-properties.md
Last active April 28, 2025 13:41
MS Office prefixed style properties can be used for older versions of MS Excel, MS PowerPoint or MS Word when you want to save a document, presentation, workbook, or worksheet as a web document, or even in older versions for MS Outlook.

MS Office prefixed style properties

mso-ansi-font-size

Note: Office only

mso-ansi-font-size: large | larger | <length> | medium | <percentage> | small | smaller | x-large | x-small | xx-large | xx-small
@dwchiang
dwchiang / .zshrc
Created April 16, 2014 10:30
gcloud with zsh
# The next line updates PATH for the Google Cloud SDK.
source /Users/dwchiang/google-cloud-sdk/path.zsh.inc
# The next line enables zsh completion for gcloud.
source /Users/dwchiang/google-cloud-sdk/completion.zsh.inc