e.g.
123123123 -> 123,123,123
12312312 -> 12,312,321
1000 -> 1,000
This is my solve for the 16th June Data I/O bookclub challenge.
| def common_attributes(records) | |
| # records should be T::Array[M] of any model M | |
| common = records.first.attributes.dup | |
| records.each do |r| | |
| common.each_key do |key| | |
| common.delete(key) if r.attributes[key] != common[key] | |
| end | |
| end |
| // Basic Autohack v1.0 | |
| // Basic first pass dingus script. Just grows, weakens, and hacks every loop | |
| /** @param {NS} ns */ | |
| export async function main(ns) { | |
| const args = arguments["0"]["args"]; | |
| let tgt = args[0] | |
| while(true) { |
| #!/usr/bin/python3 | |
| """ | |
| MolarFox 2024 | |
| On most platforms (Slack, Masto, Firefish, Discord, etc), you can search emotes by all words in them if the words are underscore delineated | |
| This doesn't work by default for blobfox emotes since the filenames are all 1 word | |
| This script will rename all files to be underscore delineated so you can let your software auto-index | |
| This is just a quick script I smashed out in a half hour, it's stable but could be improved w/ better encapsulation, reading dirpath from stdin etc |
| #!/bin/bash | |
| tgt_disp="eDP-1" | |
| # Determine which index the orientation will be at. +1 if tgt_disp is primary (try running the edpi_state xrandr command without the cut to see why) | |
| disp_info=$(xrandr --query --verbose | grep "$tgt_disp") | |
| if [ $(echo "$disp_info" | cut -d ' ' -f 3) == "primary" ] | |
| then | |
| cut_index=6 | |
| else |
| ! Title: Molar's Social Media Allowlist | |
| ! Description: Adguard Whitelist rules to allow some social media to function | |
| ! | |
| @@||facebook.com^ | |
| @@||fbcdn.net^ | |
| @@||fbsbx.com^ |
| { | |
| "message": "This is a log detailing type and methods of the partial failure status object returned by Google grpc after an `add_offline_user_data_job_operations` call", | |
| "type": "<class 'google.rpc.status_pb2.Status'>", | |
| "methods": [ | |
| "ByteSize", | |
| "Clear", | |
| "ClearExtension", | |
| "ClearField", | |
| "CopyFrom", | |
| "DESCRIPTOR", |
| #!/usr/bin/python3 | |
| # MolarFox 2023 | |
| import re | |
| import tkinter as tk | |
| from tkinter.scrolledtext import ScrolledText | |
| import hashlib | |
| import urllib3 | |
| import datetime as dt |
| #!/usr/bin/python3 | |
| from typing import List | |
| from dataclasses import dataclass, field | |
| from fastavro import writer, reader, parse_schema | |
| # A simple base class to load in avros, anonymise the values of every record, and write back out | |
| # For generating non-identifying example files from live cust data, all conforming to schema | |
| @dataclass |
| import random | |
| print(f"who{''.join(['r' for _ in range(1,random.randint(2,999))])}e") |