Skip to content

Instantly share code, notes, and snippets.

View edwardoverthere's full-sized avatar
💭
Thinking about waffles...

Edward Darling edwardoverthere

💭
Thinking about waffles...
View GitHub Profile
@kmelve
kmelve / LinkedInEmbedInput.tsx
Last active September 18, 2024 15:19
LinkedIn Embed Input for Sanity Studio
import React, { useState } from "react"
import { TextInput, Stack } from "@sanity/ui"
import { set, unset } from "sanity"
interface LinkedInEmbed {
_key: string
_type: string
postUrl: string
height: number
}
@jeremybradbury
jeremybradbury / six_digit_code.sql
Last active January 9, 2022 09:23
Six Digit Code generated by PostgreSQL on one line. Simple function too.
-- source oneliner - all caps letters + 10 digits - base 36 ~2.17B enums
SELECT array_to_string(array(select substr('ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',((random()*(36-1)+1)::integer),1) from generate_series(1,6)),'') AS "Code";
/*
Code
--------
EY25QI
(1 row)
*/
@bzerangue
bzerangue / json-to-ndjson.md
Last active April 17, 2025 12:09
JSON to NDJSON

NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.

  • Each line is a valid JSON value
  • Line separator is ‘\n’

1. Convert JSON to NDJSON?

cat test.json | jq -c '.[]' > testNDJSON.json
@PurpleBooth
PurpleBooth / README-Template.md
Last active April 29, 2025 02:22
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@Kartones
Kartones / postgres-cheatsheet.md
Last active April 30, 2025 12:26
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@LeverOne
LeverOne / LICENSE.txt
Created October 24, 2011 04:17 — forked from jed/LICENSE.txt
generate random v4 UUIDs (107 bytes)
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE