Skip to content

Instantly share code, notes, and snippets.

View mike-pete's full-sized avatar

Mike Peterson mike-pete

  • San Francisco, CA
View GitHub Profile
@mike-pete
mike-pete / day6.txt
Last active October 7, 2021 01:30
Mobile Friendly Day 6
1. Use this template to create a new repo named "event-landing-page"
https://github.com/gerbriel/Bootstrap-template
2. Clone your new repo to your computer
3. Create a new branch named daily-challenge
git checkout -b daily-challenge
4. Recreate the jumbotron and speaker sections according to this wireframe
https://geekwiseacademy.github.io/virtual-mobile-friendly-websites/img/event-landing-page-wireframe.jpg
@mike-pete
mike-pete / cheatsheet.md
Last active September 9, 2023 16:54
Git Cheat Sheet

rebase the last 4 commits: git rebase -i origin/<branch name>~4 development

clone again in a different directory: git worktree add ../the_project_2 <branch>

intereactive rebase: rebase -i origin/development

create branch: git branch

@mike-pete
mike-pete / changeTerminal.md
Last active October 28, 2021 17:33
Change default terminal in VS Code

Change the default terminal in VS Code

  1. Press F1
  2. Type Terminal: Select Default Profile (or Terminal: Select Default Shell in older VS Code versions), then press Enter.
  3. Use the arrow keys to scroll to your preferred terminal (I recommend Git Bash).
  4. Press Enter to make the change.
@mike-pete
mike-pete / GitHub-RSA-Key.md
Last active November 28, 2024 17:12
GitHub Key
  1. Use git bash to generate ssh key ssh-keygen -t rsa -C "[email protected]"

You need to set a password to avoid issues. When you are setting your key password, nothing will show in the terminal when you enter your password, this is normal, don't panic!

  1. Print out the pub key cat ~/.ssh/id_rsa.pub
  2. Copy that key and add it to https://github.com/settings/keys (New SSH key)
  3. Test to make sure everything is peachy ssh -T [email protected]
@mike-pete
mike-pete / mouseMover.ino
Created January 15, 2022 03:44
Move the mouse back and forth to keep a computer awake
#include <DigiMouse.h>
#include <oddebug.h>
#include <osccal.h>
#include <osctune.h>
#include <usbconfig-prototype.h>
#include <usbconfig.h>
#include <usbdrv.h>
#include <usbportability.h>
void setup() {
@mike-pete
mike-pete / verifyJWT.js
Created April 11, 2022 16:13
An example of verifying JWTs from a Cloudflare Function.
// the origonal gist that this code is based off of:
// https://gist.github.com/bcnzer/e6a7265fd368fa22ef960b17b9a76488
// these are refrences for firebase stuff:
// https://www.googleapis.com/service_accounts/v1/jwk/[email protected]
// https://www.googleapis.com/robot/v1/metadata/x509/[email protected]
export default async function verifyJWT(request) {
const encodedToken = getJwt(request)
if (encodedToken === null) {
@mike-pete
mike-pete / getRedditCommenters.js
Created May 16, 2022 00:13
get a list of all reddit users that commented on a post
let commenters = document.querySelectorAll('[data-testid="comment_author_link"]')
let commenterData = {}
commenters.forEach(commenter => commenterData[commenter.text] = commenter.href)
console.log(commenterData)
@mike-pete
mike-pete / README.md
Created May 31, 2022 23:46
D&D Stat Roller
  1. Roll a 6 sided die 4 times.
  2. Remove the lowest dice result.
  3. Add up the remaining numbers to get an ability score.
  4. Write down this ability score on note paper.
  5. Repeat these steps until you have 6 ability scores.
@mike-pete
mike-pete / bakingConversions.py
Created June 7, 2022 06:21
Baking conversions in Python
conversions = {
'cup': 1,
'ml': 236.588,
'tbsp': 16,
'tsp': 48
}
unitAlias = {
'cups': 'cup',
'mls': 'ml',
class Solution:
def romanToInt(self, s: str) -> int:
numerals = {
'I': 1,
'V': 5,
'X': 10,
'L': 50,
'C': 100,
'D': 500,
'M': 1000