Skip to content

Instantly share code, notes, and snippets.

View heathkit's full-sized avatar

Michael Giambalvo heathkit

View GitHub Profile
let servers = [];
/** @param {NS} ns */
export async function main(ns) {
ns.tail()
ns.disableLog("ALL")
let previousHost = ns.args[0];
ns.printf("Previous host: %s", previousHost);
let currentHost = ns.getHostname();
await scan(ns, currentHost);
// optimal_hack.js
/**
* TODO
* - split jobs to fit in available machines
* - determine ideal growth factor based on resource?
* - determine hack amount based on resources (or as parameter)
*/
/** @param {NS} ns */
export async function main(ns) {
/**
* TODO
* - job chunking
* - determine ideal growth factor based on resource?
* - determine hack amount based on resources (or as parameter)
*/
/** @param {NS} ns */
export async function main(ns) {
let target = ns.args[0]
ns.disableLog('ALL')
let servers = [];
/** @param {NS} ns */
export async function main(ns) {
ns.disableLog("ALL")
let previousHost = ns.args[0];
ns.printf("Previous host: %s", previousHost);
let currentHost = ns.getHostname();
ns.tail()
await scan(ns, currentHost);
// deploy.js
/** @param {NS} ns */
export async function main(ns) {
let previousHost = ns.args[0]
ns.printf("Previous host: %s", previousHost)
let currentHost = ns.getHostname()
let hosts = ns.scan()
for (let host of hosts) {
if (host === previousHost) continue;
if (ns.getServerRequiredHackingLevel(host) < ns.getHackingLevel()) {
@heathkit
heathkit / gist:77d47742b15a009054f8899f9bc683bc
Created December 1, 2021 20:10
Shopify JSON template with customization
{
"sections": {
"main": {
"type": "main-product",
"blocks": {
"vendor": {
"type": "text",
"disabled": true,
"settings": {
"text": "{{ product.vendor }}",
You are Flort, a wizard living in the kingdom of Larion. You have a staff and
a spellbook. You finish your long journey and finally arrive at the ruin you've
been looking for. You look around and see that it's not much different than
when you left it. The ground is cracked and worn down, but otherwise there isn't
anything special about this place.
You enter the ruined structure and begin to search the area
> read spellbook
Flort opens up his spellbook and begins to study the pages. He looks through
several spells before he finds one that seems to be appropriate for what he
#include <iostream>
#include <memory>
class Foobar
{
private:
int _array[10];
public:
Foobar() {
for( int i=0; i<10; i+=1)
var lm = {
buildDefaultAccumulator: function() {
return new lm.Accumulator(0);
},
version: '0.1'
};
lm.Accumulator = function(initial) {
this.value = initial;
noremap i a
noremap g d
noremap w <UP>
noremap a <LEFT>
noremap s <DOWN>
noremap d <RIGHT>
noremap W H
noremap S L