This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Create Storybook Story": { | |
"prefix": ["sbstory", "storybookstory"], | |
"body": [ | |
"import type { Meta, StoryObj } from '@storybook/react';", | |
"import ${1:${TM_FILENAME_BASE/(.*)\\.stories$/$1/}} from './${1:${TM_FILENAME_BASE/(.*)\\.stories$/$1/}}';", | |
"", | |
"const meta = {", | |
"\tcomponent: ${1:${TM_FILENAME_BASE/(.*)\\.stories$/$1/}},", | |
"\targs: {", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Options = { | |
width?: number; | |
height?: number; | |
class?: string; | |
}; | |
const convertMdImgToHtml = (markdownImages: string[], options?: Options) => { | |
const convertedImages = markdownImages.map((markdownImage) => { | |
return markdownImage.replace( | |
/!\[(.*?)\]\((.*?)\)/g, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
index: 0, | |
timestamp: 1537236800416, | |
data: 'Genesis Block', | |
prevHash: '0', | |
thisHash: 'a0fec317fe451b2aaeefc62db8e58a69a2eb72811bc0618693815c428882e4b0' | |
}, | |
{ | |
index: 1, | |
timestamp: 1537236800417, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder