Skip to content

Instantly share code, notes, and snippets.

@ks--ks
ks--ks / retention_cohorted_example.sql
Last active January 4, 2024 22:34
Multiple ways to get cohorted user retention in SQL
/* B2B. Getting daily or monthly retention for free users
Input tables:
signups - user_id, s.signup_date
activity - user_id, activity_date
*/
-- CREATE VIEW cohort_user_retention AS
@tlakomy
tlakomy / Production Ready Serverless notes.md
Last active January 10, 2022 01:06
Notes from Production Ready Serverless course with theburningmonk

Week 01

Lambda 101:

  • You can pin frequently used services to top bar in AWS Console
  • By default there's a limit of 1000 concurrent lambda executions, this can be raised with a support ticket. There are companies that have this limit raised up to tens of thousands concurrent lambda executions.
  • By default you get 75GB of code storage (so up to 10 React apps, lol) which can also be raised
  • Looking at Throttles graph is useful, we don't want our functions to be throttled
  • ConcurrentExecutions graph is useful as well - to understand if we're not approaching a limit
  • You can search for lambda functions using function name (adding prefixed help!) or using tags, which are really useful
  • It's possible to use custom runtimes for Lambda (apart from Node,.NET, Python etc.) so if you really want to use Haskell you can do that
@corrieriluca
corrieriluca / App-Store-Connect-API-Python.md
Last active April 23, 2024 04:50
Connection to the App Store Connect API using Python3
@Wolfr
Wolfr / svelte-resources.md
Last active April 29, 2023 07:13
Svelte resources list
@pngwn
pngwn / ssg.md
Last active December 26, 2023 07:26
A Simple Svelte SSG.

The Simplest Svelte Static Site Generator

Assuming you don't want to statically export a Sapper app, most of the parts to build a simple SSG for Svelte already exist. The only thing that is missing is the tooling ('only').

However, you don't need a lot to get things going: just a couple of rollup builds and a config file will get you most of the way there. Just some glue.

What follows is a bunch of rambling, half thought out thoughts on how I would probably go about this. Most of the stuff discussed here is stuff I've actually done or half done or am in the process of doing with varying degrees of success. It is something I'll be spending more time on in the future. There are other things I have done, want to do, or think would be a good idea that are not listed here as they don't fall into the scope of a simple SSG.

*Dislaimer: This is how I would build an SSG, this isn't the only way, but I like this approach as there are a bunch of compile-time optimisations you can per

@kez
kez / slugify.sql
Created May 13, 2019 14:50 — forked from ianks/slugify.sql
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent"
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"lowercase" AS (
@coco98
coco98 / elgordino-hasura.tf
Created December 19, 2018 08:31
Terraform spec for Hasura on Fargate and RDS
provider "aws" {
region = "${var.region}"
}
### VPC
# Fetch AZs in the current region
data "aws_availability_zones" "available" {}
resource "aws_vpc" "datastore" {
cidr_block = "172.17.0.0/16"
@alexcjohnson
alexcjohnson / LICENSE
Last active March 25, 2024 12:17
Working with React and D3 together
The MIT License (MIT)
Copyright (c) Plotly, Inc
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@onyxfish
onyxfish / README.md
Created March 30, 2017 14:06
Import the entire Bureau of Labor Statistics (BLS) Quarterly Census of Wages (QCEW) dataset into a PostgreSQL database

QCEW Data Loader

These scripts import the entire Bureau of Labor Statistics Quarterly Census of Employement and Wages (from 1990 to latest) into one giant PostgreSQL database.

The database created by this process will use about 100GB of disk space. Make sure you have enough space available before you start!

Configuration

Database name, table name, and more can be configured via config.sh.

@hollodotme
hollodotme / Install-php7.md
Last active August 11, 2022 06:23
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions