Skip to content

Instantly share code, notes, and snippets.

class Character {
constructor(name, strength, agility, criticalStrikeChance, criticalStrikeBonus, dodge) {
this.name = name;
this.strength = strength;
this.agility = agility;
this.criticalStrikeChance = criticalStrikeChance;
this.criticalStrikeBonus = criticalStrikeBonus;
this.dodge = dodge;
this.health = 100; // Starting health
}
var Character = function(name, strength, agility, criticalStrikeChance, criticalStrikeBonus, dodge) {
this.name = name;
this.strength = strength;
this.agility = agility;
this.criticalStrikeChance = criticalStrikeChance;
this.criticalStrikeBonus = criticalStrikeBonus;
this.dodge = dodge;
this.health = 100; // Starting health
};
export function getDiffTimeBetweenCurrentDate (dateString = '', now = new Date()) {
const dayInMilliseconds = 86400000
if ([null, undefined, false, true].includes(dateString)) {
return dateString
}
const date = new Date(dateString)
const isInvalidDate = isNaN(date.getTime())
if (isInvalidDate) {
return dateString
@chranderson
chranderson / nvmCommands.js
Last active April 28, 2024 17:22
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
@JunkFood02
JunkFood02 / Motion.kt
Last active April 28, 2024 17:22
A music player demo made with Jetpack Compose animation APIs, including shared element transition, list animations, animated content, etc.
package com.example.compose_debug
import androidx.compose.animation.EnterTransition
import androidx.compose.animation.ExitTransition
import androidx.compose.animation.core.CubicBezierEasing
import androidx.compose.animation.core.Easing
import androidx.compose.animation.core.FastOutLinearInEasing
import androidx.compose.animation.core.FastOutSlowInEasing
import androidx.compose.animation.core.LinearOutSlowInEasing
import androidx.compose.animation.core.PathEasing
@tuxity
tuxity / navicat_premium_reset_trial.sh
Last active April 28, 2024 17:21
Reset Navicat Premium 15/16 remaining trial days
#!/bin/bash
set -e
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
regex="CFBundleShortVersionString = \"([^\.]+)"
[[ $file =~ $regex ]]
version=${BASH_REMATCH[1]}
@carlin-q-scott
carlin-q-scott / ReferenceResolverWithNames.cs
Last active April 28, 2024 17:20
A JSON.Net IReferenceResolver that resolves field references using a Name property if available, otherwise it uses an index
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json.Serialization;
namespace MyNewtonsoftExtensions
{
public class ReferenceResolverWithNames : IReferenceResolver
{
private readonly ReferenceCollection _collection = new ReferenceCollection();
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active April 28, 2024 17:18
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 28, 2024 17:22
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory