Skip to content

Instantly share code, notes, and snippets.

  • tiny-invariant
  • outdent
@alexturpin
alexturpin / temporal.ts
Last active May 2, 2024 14:00
Temporal with Zod + tRPC
import { Temporal } from "@js-temporal/polyfill"
import { z } from "zod"
/*
"Zod extras", use like z.
date: zx.instant()
*/
export const zx = {
@alexturpin
alexturpin / cf.keylayout
Last active October 27, 2021 04:50
Canadian French key layout for macOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--
Clavier canadien français pour macOS
Auteur original: Sébastien Guillemette (2004)
Mainteneurs actuels: Jonathan Allard, Matthieu Yiptong
<https://github.com/ergosteur/cf-keylayout>
@alexturpin
alexturpin / emoji.js
Created July 12, 2021 15:34
Emoji fun
["👨", "‍", "👩", "‍", "👧", "‍", "👦"].join('')
# G0063482.JPG, G0063483.JPG, ...
./ffmpeg -r 24 -start_number 63482 -i 'G%07d.JPG' -s hd1080 -vcodec libx264 timelapse.mp4
@alexturpin
alexturpin / video.sh
Created January 5, 2020 06:12
ffmpeg slideshow generate
#!/bin/sh
./bin/ffmpeg -framerate 1/6 -start_number 1 -i "photos/pic (%d).jpg" -y -pix_fmt yuv420p -vf "scale='min(1280,iw)':min'(720,ih)':force_original_aspect_ratio=decrease,pad=1280:720:(ow-iw)/2:(oh-ih)/2" slideshow.mp4
@alexturpin
alexturpin / .hyper.js
Created April 2, 2019 22:38
Hyper config
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@alexturpin
alexturpin / guid.js
Created January 10, 2019 20:20
Quick and dirty "GUID"
const guid = () => Math.random().toString(36).substr(2);