This file contains 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
export class RawMessageDataBuilder { | |
private msg = ""; | |
constructor({ | |
to, | |
fullname, | |
email, | |
phone, | |
city, |
This file contains 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 bip39 = require("bip39"); | |
const hdkey = require("ethereumjs-wallet").hdkey; | |
async function find() { | |
const mnemonic = "word1 word2 ... word24" | |
const buf = await bip39.mnemonicToSeed(mnemonic); | |
const hdwallet = hdkey.fromMasterSeed(buf); | |
const path = "m/44'/60'/0'/0/0"; | |
const wallet = hdwallet.derivePath(path).getWallet(); |
This file contains 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
// | |
// Werewolf, it shall have 30 HP and 5 DMG | |
class Werewolf extends Enemy { | |
constructor(){ | |
super('Werewolf', 30, 5); | |
} | |
} | |
// Vampire, it shall have 50 HP and 10 DMG | |
class Vampire extends Enemy { | |
constructor(){ |
This file contains 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 primaryColor = "#15C3B2"; | |
const secondaryColor = "#227C9D"; | |
const theme = createMuiTheme({ | |
palette: { | |
primary: { | |
main: primaryColor, //"#49cbdc", | |
}, | |
secondary: { | |
main: secondaryColor, // "#ff4081", |
This file contains 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
// my backend return all date in a UTC format without "Z" at the end of string. I want to add a "Z" for all data that contain a date | |
// from "2020-05-21T19:51:25.396" to "2020-05-21T19:51:25.396Z" | |
const object: any = { | |
name: "-", | |
created_at: "-", | |
created_when: "-", | |
calendar: { | |
updated_at: "-", |
This file contains 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
export interface I_AttachmentsContext { | |
urls: string[]; | |
setUrls: (values: string[]) => void; | |
} | |
const AttachmentsContext = React.createContext<I_AttachmentsContext>({ | |
urls: [], | |
setUrls: (values: string[]) => { | |
// | |
} |
This file contains 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 MOST_USED = ["BASE", "INTERMEDI", "REJECTED", "FULL"] // ["BASE", "INTERMEDI", "REJECTED", "FULL"]; | |
const list = ["super","base wire","base","START","PREMIUM","PLUS","Intermedi","Blocked","Advanced"] // ["REJECTED",",ciccio","FULL","INTERMEDI","BASE"] | |
function beautifulSort(a,b){ | |
const i1 = MOST_USED.indexOf(a.toUpperCase()) | |
const i2 = MOST_USED.indexOf(b.toUpperCase()) | |
if(MOST_USED.includes(a.toUpperCase()) && MOST_USED.includes(b.toUpperCase)){ | |
return i1-i2 | |
} | |