Skip to content

Instantly share code, notes, and snippets.

@jeek
jeek / POST.js
Last active May 19, 2024 13:14
POST.js - Just-after post-reset/post-install hacking level initialization
// POST.js v0.4
// A power-on self test for the player's hacking skill
//
// I am so sorry.
// Written by jeek
let FILENAME = "/POST.js";
// Ram Dodging
export async function Do(ns, command, ...args) {
@jeek
jeek / jeekOS.js
Created March 28, 2024 22:58
jeekOS
import { NS, Player, Server, ResetInfo } from "@ns";
let gangMemberNames: string[] = [
[
"Aries",
"Taurus",
"Gemini",
"Cancer",
"Leo",
"Virgo",
@jeek
jeek / 355.ipynb
Last active July 18, 2023 01:05
Euler #355
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeek
jeek / truxican.js
Created October 9, 2022 00:25
truxican fire drill
// Reassigns your employees to the jobs they're best suited for, while maintaining the same number of employees in each position.
class Employee {
constructor (ns, division, city, name) {
this.ns = ns;
this.division = division;
this.city = city;
this.name = name;
}
get int() {
@jeek
jeek / packitin.js
Created October 8, 2022 22:39
packitin.js
// packitin.js by jeek
// death to the Zoë cult (not Zoë herself, though, she's cool)
let mults = [
[.30, .20, .72, .30], // 0 - Agriculture
[.20, .20, .25, .25], // 1 - Chemical
[.19, .00, .20, .36], // 2 - Computer
[.30, .00, .65, .05], // 3 - Energy
[.20, .35, .50, .15], // 4 - Fishing
[.25, .15, .05, .30], // 5 - Food
@jeek
jeek / gangs.js
Last active November 6, 2022 03:20
Bitburner Gangs v0.0
let GANG = "Slum Snakes";
let WANTED_THRESHOLD = 10; // If your wanted level is higher than this and your penalty is greater than (1-WANTED_PENALTY_THRESHOLD)....
let WANTED_PENALTY_THRESHOLD = .9; // ... then do vigilante stuff.
let TRAFFICK_CHANCE = .8; // Odds of arms trafficking vs terrorism when there is no Formulas.exe
let REP_CHECK = 1.1; // Don't ascend anyone with over 1.1x the average rep of the group.
let MINIMUM_RESPECT = 0; // Don't start ascension until the average respect is at least this.
let CLASH_TARGET = .5; // Don't go to war until you have this much of a chance against all remaining gangs.
let ASC = 1.06;
import { createSidebarItem } from "/jeekOS.js"
@jeek
jeek / jeekOS.js
Last active May 13, 2022 11:44
jeekOS.js - an experiment in memory management
let VERSION = "0.0";
let toasty = false;
let POST_INSTALL_SCRIPT = '/jeek/start.js';
let WORLDS = {
1: "Source Genesis",
2: "Rise of the Underworld",
3: "Corporatocracy",
4: "The Singularity",
@jeek
jeek / puzzleaday.py
Created May 25, 2021 19:27
Puzzle a Day Attempt #1
from copy import deepcopy as copy
from heapq import heappop, heappush
pieces = [
[[[ 0, 0, 1, 0 ],
[ 1, 1, 1, 0 ],
[ 1, 0 ,0 ,0 ],
[ 0, 0, 0, 0 ]]],
[[[ 1, 0, 1, 0],
[ 1, 1, 1, 0],
@jeek
jeek / Makefile
Last active December 3, 2017 02:45
python 3 project euler
all: real
real:
python3 euler.py
test:
python3 -munittest -v euler.py
clean:
rm -rf *~ __pycache__
ignore = [10 ** j for j in xrange(100)]
i = 10
while True:
if i not in ignore:
for j in xrange(1, len(str(i))):
a, b = int(str(i)[:j]), int(str(i)[j:])
for power in xrange(1, 11):
c = a ** power + b ** power
for k in xrange(1, len(str(c))):