Skip to content

Instantly share code, notes, and snippets.

View oscartbeaumont's full-sized avatar

Oscar Beaumont oscartbeaumont

View GitHub Profile
@benja
benja / keybindings.json
Last active December 18, 2022 15:19
Visual Studio Code — Exclude .gitignore files on command
[
{
"key": "shift+cmd+[Period]",
"command": "settings.cycle.explorer.excludeGitIgnore"
},
]
@acorn1010
acorn1010 / available_domains.txt
Last active September 11, 2022 17:58
Small Domain Tool and 2-character .gg domains
# These domains were available as of about 2 days ago. Best of luck!
https://www.namecheap.com/domains/registration/results/?domain=a7.gg
https://www.namecheap.com/domains/registration/results/?domain=a8.gg
https://www.namecheap.com/domains/registration/results/?domain=b6.gg
https://www.namecheap.com/domains/registration/results/?domain=b7.gg
https://www.namecheap.com/domains/registration/results/?domain=c8.gg
https://www.namecheap.com/domains/registration/results/?domain=d7.gg
https://www.namecheap.com/domains/registration/results/?domain=d8.gg
https://www.namecheap.com/domains/registration/results/?domain=e0.gg
https://www.namecheap.com/domains/registration/results/?domain=e5.gg
@lawrencecchen
lawrencecchen / $.ts
Last active April 11, 2024 04:23
next-auth with remix
// app/routes/api/auth/$.ts
import NextAuth from "~/lib/next-auth/index.server";
export const { action, loader } = NextAuth({
providers: [
GoogleProvider({
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
}),
],
@anastaciocintra
anastaciocintra / Compare two data objects .md
Last active March 19, 2023 19:12
Compare two objects JS

Compare two data objects / arrays in javascript and/or typescript regardless of the order of the data;

When to use:

  • When you need compare two "json" objects to know if it have same data.
  • When the order of the array doesn't matters ie. [1,2] should be equal [2,1], but it is configurable.
  • lightweight - just one small .js file

when not to use:

  • when you need to compare more complex objects, with functions, for example.
@jix
jix / main.rs
Created January 29, 2022 17:09
Lifetime GAT emulation on stable rust
// This is a technique to emulate lifetime GATs (generic associated types) on stable rust starting
// with rustc 1.33.
//
// I haven't seen this exact technique before, but I would be surprised if no one else came up with
// it. I think this avoids most downsides of other lifetime GAT workarounds I've seen.
//
// In particular, neither implementing nor using traits with emulated lifetime GATs requires adding
// any helper items. Only defining the trait requires a single helper trait (+ a single helper impl
// for the 2nd variant) per GAT. This also makes the technique viable without any boilerplate
// reducing macros.
@noelbundick
noelbundick / README.md
Created October 14, 2021 16:15
Optimizing Rust container builds

Optimizing Rust container builds

I'm a Rust newbie, and one of the things that I've found frustrating is that the default docker build experience is extremely slow. As it downloads crates, then dependencies, then finally my app - I often get distracted, start doing something else, then come back several minutes later and forget what I was doing

Recently, I had the idea to make it a little better by combining multistage builds with some of the amazing features from BuildKit. Specifically, cache mounts, which let a build container cache directories for compilers & package managers. Here's a quick annotated before & after from a real app I encountered.

Before

This is a standard enough multistage Dockerfile. Nothing seemingly terrible or great here - just a normal build stage, and a smaller runtime stage.

@ourownstory
ourownstory / encrypted_dual_boot_xps_17.md
Last active January 7, 2024 13:31
Encrypted dual boot setup for Pop!_OS and Windows 10 using LUKS and Bitlocker on Dell XPS 17 9700

Encrypted dual boot setup with Pop!_OS and Windows 10

How to guide, using LUKS and Bitlocker on Dell XPS 17 9700

This guide is for those who want to use their XPS 17 in dual boot with their (preinstalled) Windows 10 and a new Pop!_OS installation, without giving up Bitlocker Encryption in Windows nor LUKS encryption in Linux.

The only guides that I could find were for Ubuntu, which it should be identical to, but I found the ommission of a few steps to resolve issues that I encountered in my first install attempt. Hoping to save you some trouble, I am sharing the steps that worked for me, linking the original guides that I found useful.

1. Preparation

  • 1.1 Of course: Backup all your data! You always do this when people tell you to, right? Maybe this time better be safe than sorry.
  • 1.2 Safely note your Bitlocker recovery key somewhere off your XPS. Where to find it
@KATT
KATT / favourite-ts-tricks.md
Last active July 26, 2023 06:16
🧙‍♂️ Favourite non-obvious TS tricks

Record<string, x | undefined>

Represent maps

// rather than 
const map: {[ key: string ]: string} = {
  foo: 'bar',
}
@bastjan
bastjan / hello.jsonnet
Created March 24, 2020 18:27
a cronjob definition for ksonnet/tanka
(import "ksonnet-util/kausal.libsonnet") +
{
local cronJob = $.batch.v1beta1.cronJob,
local container = $.core.v1.container,
hello_container::
container.new("hello", "busybox") +
container.withCommand([
"sh",
"-c",
@silver-xu
silver-xu / ts-boilerplate.md
Last active May 14, 2024 07:49
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting