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 / README.md
Last active February 2, 2021 16:31
Discord Token Security

This gist takes advantage of GitHub's Token Scanning feature to reset Discord Bot tokens that users post on Discord.

@Fyko
Fyko / ME.txt
Last active April 17, 2021 19:46
Sponsor Roles Metadata
Fyko#0001 (492374435274162177)
@Fyko
Fyko / LogHandler.ts
Last active July 18, 2021 22:13
utility for batch-handling general discord server logs, sending 10 embeds at a time
/**
* Copyright 2021 Carter "Fyko" Himmel
*
* 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:
*
/**
* Chunks an array of strings into an array of an array of strings
* where the total characters of the strings in each chunk is less than
* or equal to `maxChunkCharacters`.
* @param data An array of strings
* @param maxChunkCharacters The maximum amount of characters that should be allowed per chunk
* @param join The character that each string will later be joined on
* @returns An array of an array of strings
* @example
* ```ts
@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',
@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}`;
/**
fn main() {
println!("hello world");
}
sudo wget -O /usr/bin/envup https://gist.githubusercontent.com/Fyko/6bb4e995e58a9605eebdab85b749308d/raw/d9e7edbeae7cd76a9eae683c3926dd12b65c8a87/envup.sh
sudo chmod +x /usr/bin/envup

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:

@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]