Skip to content

Instantly share code, notes, and snippets.

View madisonbullard's full-sized avatar
🤺
Fencing

Madison Bullard madisonbullard

🤺
Fencing
View GitHub Profile
@madisonbullard
madisonbullard / gist.ts
Last active August 2, 2024 04:00
Copy your .env file to GitHub Repository Secrets using TypeScript
// Make sure dotenv and libsodium-wrappers are installed as dev dependencies
// Make sure GITHUB_ACCESS_TOKEN is declared in your .env file as a Fine-Grained Token with Secrets read/write access
import dotenv from 'dotenv';
import { readFileSync } from 'fs';
import sodium from 'libsodium-wrappers';
import path from 'path';
import { fileURLToPath } from 'url';
const baseUrl = 'https://api.github.com/repos/{USER}/{REPO}/actions/secrets';
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Which plugins would you like to load?
# Standard plugins can be found in $ZSH/plugins/
# Custom plugins may be added to $ZSH_CUSTOM/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(
git

Keybase proof

I hereby claim:

  • I am madisonbullard on github.
  • I am madisonbullard (https://keybase.io/madisonbullard) on keybase.
  • I have a public key ASA3VB76__POeL_3ydnaI819GxTszytLkZJd83MVhPz0fgo

To claim this, I am signing this object:

@madisonbullard
madisonbullard / bearer_token_request.js
Last active July 26, 2017 20:28
Request a bearer token from Twitter with Meteor
import Twitter from 'twitter';
import Future from 'fibers/future';
const { consumerKey, secret } = Meteor.settings.private.oAuth.twitter;
let bearerToken = null;
function bearerTokenRequestString(consumerKey, secret){
const rawKeyEncode = (str) => {
return encodeURIComponent(str) //return RFC 1738 encoded string
.replace(/!/g, '%21')