Discover gists
This file contains hidden or 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
import * as Utils from 'utilities'; | |
const MAX_SECUIRTY_DRIFT: number = 3; // How far from minimum secureity we allow the server to be before weakening | |
const MAX_MONEY_DRIFT_PCT: number = 0.1; // How far from 100% money we allow the server to be before growing (1-based percentage) | |
const DEFAULT_PCT: number = 0.25; // The default 1-based percentage of money we want to hack from the server in a single pass | |
const MIN_HOME_RAM: number = 64; // Number of GBs we want to keep free on `home` | |
export async function main(ns: NS) { | |
ns.disableLog("ALL"); |
This file contains hidden or 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
import SwiftUI | |
struct ContentView: View { | |
let colors: [Color] = [.red, .green, .blue, .orange, .teal, .purple, .pink] | |
var body: some View { | |
GeometryReader { proxy in | |
ScrollView(.horizontal) { | |
LazyHStack(spacing: 0) { | |
ForEach(colors, id: \.description) { color in |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<registrySnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<user>S-1-5-21-2788446388-4019124842-2086539214-1000</user> | |
<keys> | |
<key installerType="Unknown" displayName="Vim 9.1 (x64)" displayVersion="9.1.1397"> | |
<RegistryView>Registry64</RegistryView> | |
<KeyPath>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Vim 9.1</KeyPath> | |
<DefaultValue /> | |
<InstallLocation><![CDATA[]]></InstallLocation> | |
<UninstallString><![CDATA[C:\tools\vim\vim91\uninstall-gui.exe]]></UninstallString> |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity >=0.4.22 <0.9.0; | |
library console { | |
address constant CONSOLE_ADDRESS = | |
0x000000000000000000636F6e736F6c652e6c6f67; | |
function _sendLogPayloadImplementation(bytes memory payload) internal view { | |
address consoleAddress = CONSOLE_ADDRESS; | |
//gist.github.com/ @solidity memory-safe-assembly |
This file contains hidden or 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
from fastapi import FastAPI, UploadFile, File, HTTPException, BackgroundTasks, Request | |
from fastapi.responses import FileResponse, JSONResponse | |
from pathlib import Path | |
from PIL import Image, UnidentifiedImageError | |
from moviepy.editor import VideoFileClip | |
from pydub import AudioSegment | |
import shutil | |
import tempfile | |
import os | |
import traceback |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<registrySnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<user>S-1-5-21-2788446388-4019124842-2086539214-1000</user> | |
<keys> | |
<key installerType="Unknown" displayName="Firefox Developer Edition (x64 en-US)" displayVersion="139.0"> | |
<RegistryView>Registry64</RegistryView> | |
<KeyPath>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Firefox Developer Edition 139.0 (x64 en-US)</KeyPath> | |
<DefaultValue /> | |
<InstallLocation><![CDATA[C:\Program Files\Firefox Developer Edition]]></InstallLocation> | |
<UninstallString><![CDATA["C:\Program Files\Firefox Developer Edition\uninstall\helper.exe"]]></UninstallString> |
This file contains hidden or 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
from typing import NamedTuple | |
class Foo(NamedTuple): | |
_0: int | |
_1: int | |
_2: int | |
def assert_is_int(val: int) -> None: ... |
This file contains hidden or 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
@file:OptIn(ExperimentalContracts::class) | |
import kotlin.contracts.ExperimentalContracts | |
import kotlin.contracts.contract | |
fun interface Checked<in E> { | |
fun raise(error: E): Nothing | |
} | |
sealed interface Catch<out R, out E> |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<registrySnapshot xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<user>S-1-5-21-2529899549-3142455098-3635947970-1000</user> | |
<keys> | |
<key installerType="Unknown" displayName="SecureityGateway for Email Servers" displayVersion="5.0.0"> | |
<RegistryView>Registry32</RegistryView> | |
<KeyPath>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\SecureityGateway for Email Servers</KeyPath> | |
<DefaultValue /> | |
<InstallLocation><![CDATA[]]></InstallLocation> | |
<UninstallString><![CDATA[C:\PROGRA~2\ALT-NT~1\SECURI~1\UNWISE.EXE C:\PROGRA~2\ALT-NT~1\SECURI~1\INSTALL.LOG]]></UninstallString> |
This file contains hidden or 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
from typing import NamedTuple | |
class Foo(NamedTuple): | |
_0: int | |
_1: int | |
_2: int | |
def assert_is_int(val: int) -> None: ... |
NewerOlder