Skip to content

Instantly share code, notes, and snippets.

View riccjohn's full-sized avatar
☠️

John Riccardi riccjohn

☠️
View GitHub Profile
@riccjohn
riccjohn / convertMdImgToHtml.ts
Last active February 5, 2025 22:31
Convert markdown images to html image tags
type Options = {
width?: number;
height?: number;
class?: string;
};
const convertMdImgToHtml = (markdownImages: string[], options?: Options) => {
const convertedImages = markdownImages.map((markdownImage) => {
return markdownImage.replace(
/!\[(.*?)\]\((.*?)\)/g,
// ==UserScript==
// @name Display current year PTO only
// @namespace MetricAi
// @version 2024-03-26
// @description Hides PTO from previous & future calendar years
// @author You
// @match https://psa.metric.ai/home/my-timeoff/policies/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=metric.ai
// @grant none
// ==/UserScript==
// ==UserScript==
// @name MetricAI Max Width
// @namespace MetricAi
// @version 2024-03-29
// @description Make content full width
// @author You
// @match *://psa.metric.ai/home/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=metric.ai
// @grant none
// ==/UserScript==
{
index: 0,
timestamp: 1537236800416,
data: 'Genesis Block',
prevHash: '0',
thisHash: 'a0fec317fe451b2aaeefc62db8e58a69a2eb72811bc0618693815c428882e4b0'
},
{
index: 1,
timestamp: 1537236800417,
const sha256 = require('sha256');
class Block {
constructor(index, timestamp, data, prevHash) {
this.index = index;
this.timestamp = timestamp;
this.data = data;
this.prevHash = prevHash;
this.thisHash = sha256(
this.index + this.timestamp + this.data + this.prevHash
const createBlockchain = num => {
const blockchain = [createGenesisBlock()];
let previousBlock = blockchain[0];
for (let i = 1; i < num; i += 1) {
const blockToAdd = nextBlock(previousBlock, `This is block #${i}`);
blockchain.push(blockToAdd);
previousBlock = blockToAdd;
}
console.log(blockchain);
const sha256 = require('sha256');
class Block {
constructor(index, timestamp, data, prevHash) {
this.index = index;
this.timestamp = timestamp;
this.data = data;
this.prevHash = prevHash;
this.thisHash = sha256(
this.index + this.timestamp + this.data + this.prevHash
const sha256 = require('sha256');
class Block {
constructor(index, timestamp, data, prevHash) {
this.index = index;
this.timestamp = timestamp;
this.data = data;
this.prevHash = prevHash;
this.thisHash = sha256(
this.index + this.timestamp + this.data + this.prevHash
const sha256 = require('sha256');
class Block {
constructor(index, timestamp, data, prevHash) {
this.index = index;
this.timestamp = timestamp;
this.data = data;
this.prevHash = prevHash;
this.thisHash = sha256(
this.index + this.timestamp + this.data + this.prevHash
@riccjohn
riccjohn / openpgp.txt
Created November 20, 2017 02:29
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:f5d2b6df853bb01668e1cc31a8a738dc31f2b9bb]