Skip to content

Instantly share code, notes, and snippets.

View SafetyDav3's full-sized avatar
:electron:
PTFO

David Williams SafetyDav3

:electron:
PTFO
  • 07:54 (UTC -05:00)
View GitHub Profile
@SafetyDav3
SafetyDav3 / gist:2267c96f45baae36c2d2c347ebba21ca
Created April 14, 2024 03:12
Remove node_modules from repo with one command
Use the universal one-liner in terminal in the project directory:
``` touch .gitignore && echo "node_modules/" >> .gitignore && git rm -r --cached node_modules ; git status ```
It works no matter if you've created a .gitignore or not, no matter if you've added node_modules to git tracking or not.
Then commit and push the .gitignore changes.
Explanation
@SafetyDav3
SafetyDav3 / upgrade.js
Created July 29, 2022 23:36 — forked from quonic/upgrade.js
Birburner Hacknet Node upgrade script. I found and converted this script from .script to .js.
const MoneyFormat = '$0.0a';
const TimeFormat = '00:00:00';
/** @param {import(".").NS } ns */
export async function main(ns) {
/*
ns.hacknet-auto.script for Bitburner v0.47.2
Winners don't use copyright
@SafetyDav3
SafetyDav3 / RegExTutorial.md
Last active June 28, 2022 00:34
You Need to Learn RegEx Right Now!

You Need to Learn Regular Expressions Right Now!

This tutorial will cover Regular Expressions more commonly referred to as "RegEx". To me the most interesting aspect of RegEx is that it can be used in all*¹ programming languages. RegEx can be considered a universal language of sorts due to this cross compatibility.
The most common applications for RegEx are Find, replace, and validation of string type data.

Summary

This tutorial of sorts will cover probably the most common use case for RegEx and that's email validation. Below is an example of an email validation Regular Expression.↓

Title (replace with your title)

Introductory paragraph (replace this with your text)

Summary

Briefly summarize the regex you will be describing and what you will explain. Include a code snippet of the regex. Replace this text with your summary.

Table of Contents