Skip to content

Instantly share code, notes, and snippets.

@mikeymop
mikeymop / flip_bytes.c
Last active March 29, 2024 23:46
Swap Endian-ness C
#include<stdio.h>
#include<assert.h>
/**
Accumulate into res |
1) Shift 8*i bits right, fill left in with 0xFF
( val >> (i * 8)
2) Shifts the isolated val left 8*i bits into res.
<< (size - i) * 8
3) Uses bitwise OR operation to accumulate the flipped bytes into res.
const fetch = require('node-fetch');
var testString1 = "137/erc721:0xa90a110c81e9f2aacd08ffc6d24871908612be6f/8774";
var testString2 = "1/erc721:0xa90a110c81e9f2aacd08ffc6d24871908612be6f/8774";
var testString3 = "137/erc1155:0xa90a110c81e9f2aacd08ffc6d24871908612be6f/8774"
var testString4 = "1/erc1155:0xa90a110c81e9f2aacd08ffc6d24871908612be6f/8774"
var badStringH = "137/erc721:0x723e481aef940fc7454850a83c54ca1ee770209c/291";
var badStringJ = "137/erc721:0xa6d6d5fbeb58cd8c1006fff02fd73ac8b0a9c0f2/16";
/** Returns void or the ipfs location of nft image.
* Modifies the following DBM vars:
@mikeymop
mikeymop / getNFTUri-compat.js
Last active June 7, 2022 04:34
This gets the uri of an nft pfp from the social.picture.value of an Unstoppable Domain
var https = require('https');
var resolveNFTUri = function (self, str, store, cache, actions, channel) {
log = function (msg) { console.log("getNFT: \n", msg); };
log('Finding nft uri for: ', str);
str = str[0];
var getChainId = function (str) {
@mikeymop
mikeymop / half_age.py
Created November 20, 2021 02:20
Finds the year that you will be half someone's age.
from datetime import date
from math import floor
def max_ttd(birth_year):
this_year = date.today().year
age = this_year - birth_year
max_year = (100-age) + this_year
return max_year # agv age is 75, but 100 is safe
@mikeymop
mikeymop / Part1.java
Created April 30, 2021 03:58
Assignment
package sortingArrays;
import java.util.Random;
import java.util.Scanner;
/**
<b>Part 1: Sorting Arrays</b>
<p>Develop a program that asks the user to enter a capital for a U.S. state.
Upon receiving the user input,the program reports whether the user input is correct.
<p>For this application, the 50 states and their capitals are stored in
@mikeymop
mikeymop / howto.md
Created April 1, 2021 03:27
Remove Mobile Broadband Connections gnome

Find UUID

bluetoothctl paired-devices

bluetoothctl remove [UUID]

@mikeymop
mikeymop / docker-compose.yml
Last active April 1, 2021 02:36
Plex Docker-Compose
version: "3.7"
services:
plex:
image: plexinc/pms-docker
container_name: plex
restart: unless-stopped
environment:
- TZ=America/New_York
devices:
@mikeymop
mikeymop / cr.ts
Created March 18, 2021 21:13
Compensate-rotation
/**
* Performs coordinate rotation math in order to abstract away positional discrepancies resulting from a
* rotated page.
* See: https://www.khanacademy.org/computing/pixar/sets/rotation/v/sets-8
* @param {PDFPage} page - The page that may be rotated
* @param {number} x - The desired *relative* x-coordinate of the object
* @param {number} y - The desired *relative* y-coordinate of the object
*/
public compensateRotation(page, x, y): {newX: number, newY: number} {
var dimensions = page.getSize();

Keybase proof

I hereby claim:

  • I am mikeymop on github.
  • I am mikeymop (https://keybase.io/mikeymop) on keybase.
  • I have a public key whose fingerprint is 21C7 73EE F4A0 EA93 B0CC 7D86 70F8 90BF CED1 59EE

To claim this, I am signing this object:

Pet Check-In
To update our current processes, we outline our current manual check-in process below, which involves
multiple steps and verifications.
First, we determine whether the pet is a dog or a cat. Next, we determine if boarding space is available
for the pet. There are currently 30 spaces for dogs and 12 spaces for cats. We would like the ability to
update these settings as needed. If boarding space is available, we identify whether the pet is a new or
returning visitor. If the pet has stayed with us before, we are seeking the ability to update information
as needed. If the pet is a new visitor, we would like the opportunity to collect all the appropriate
information.
Additionally, we would like the ability to gather information on the length of stay for each pet and if