Nothing Special   »   [go: up one dir, main page]

Skip to content

Instantly share code, notes, and snippets.

View Fyko's full-sized avatar
🏠
Working from home

Carter Fyko

🏠
Working from home
View GitHub Profile
@Fyko
Fyko / delete_target_dirs.sh
Last active May 17, 2024 02:34
a shell script to delete Rust's `target` directory everywhere
#!/bin/sh
CYAN="\033[36m"
GREEN="\033[32m"
RESET="\033[0m"
total_size=0
count=0
BASE_DIR="."

Keybase proof

I hereby claim:

  • I am fyko on github.
  • I am fyko (https://keybase.io/fyko) on keybase.
  • I have a public key ASCqOEO-DMy-WPFLLS6li_cDsdy45hs4cQZfx30Ug9Qitwo

To claim this, I am signing this object:

@Fyko
Fyko / README.md
Last active October 23, 2023 05:19
A script to prepend a commit to a list in a PR body section.

This is a script we use for prepend commits to our automated kube-flux staging->main PR.

Usage

$ cpanm DateTime
$ content="<!--START_SECTION:commits--><!--END_SECTION:commits-->"
$ content=$(perl ./update_commits_section.pl $content 'https://github.com/you/yours/commit/b47f8c0' "masked link content") # run this multiple times
$ echo $content
@Fyko
Fyko / Cargo.toml
Last active October 21, 2023 00:01
meilisearch sdk panic reproducable example
[package]
name = "meili-panic"
version = "0.1.0"
edition = "2021"
[[bin]]
name = "meili-panic"
path = "main.rs"
[dependencies]
@Fyko
Fyko / extractor.rs
Last active April 23, 2024 10:26
a clerk webhook verifier for axum
///! An [axum](https://docs.rs/axum) extractor for [Clerk webhooks](https://clerk.com/docs/integration/webhooks).
use axum::{
body::Bytes,
extract::FromRequest,
http::{Request, StatusCode},
response::{IntoResponse, Response},
};
// TODO: replace with your config
use happycamper_util::config::CONFIG;
use serde::{Deserialize, Serialize};

Keybase proof

I hereby claim:

  • I am carterhimmel on github.
  • I am fyko (https://keybase.io/fyko) on keybase.
  • I have a public key ASCqOEO-DMy-WPFLLS6li_cDsdy45hs4cQZfx30Ug9Qitwo

To claim this, I am signing this object:

sudo wget -O /usr/bin/envup https://gist.githubusercontent.com/Fyko/6bb4e995e58a9605eebdab85b749308d/raw/d9e7edbeae7cd76a9eae683c3926dd12b65c8a87/envup.sh
sudo chmod +x /usr/bin/envup
fn main() {
println!("hello world");
}
@Fyko
Fyko / index.ts
Last active September 5, 2022 23:27
Use an unspported Node.js version in AWS Lambda (fusebit/anynode) (serverless-stack)
#!/usr/bin/env node
import { App } from '@serverless-stack/resources';
import { request } from 'undici';
/** eg: `us-west-1`, `us-east-2` */
type AWSRegion = string;
/** eg: `18.4.0`, `16.14.0`, `14.17.0` */
type SemVersion = `${number}.${number}.${number}`;
/**
@Fyko
Fyko / function.ts
Last active July 11, 2022 18:33
Machine Token Handling for Hasura w/ Auth0
// MIT License - Copyright (c) 2022 PUSHAS PTY LTD.
import { ResourceNotFoundException, SecretsManager } from '@aws-sdk/client-secrets-manager';
import { SecretsManagerRotationHandler } from 'aws-lambda';
import fetch from 'node-fetch';
const secretsClient = new SecretsManager({});
export const generateAccessToken = async (roles: string) => {
const response = await fetch(`https://${process.env.AUTH0_M2M_DOMAIN}/oauth/token`, {
method: 'POST',