Skip to content

Instantly share code, notes, and snippets.

View SpencerSharkey's full-sized avatar

Spencer SpencerSharkey

View GitHub Profile
fn main() {}
// just some fake structs
#[derive(Debug)]
pub struct Zebra {
name: &'static str,
}
#[derive(Debug)]

File Dropper Service

This service is intended to be ran across a fleet of servers (bare metal or virtualized) to keep configuration files up to date. The clients connect to a centralized server who's implementation is out of scope for this assignment.

Your client should initiate a server-side streaming Watch request that will emit events on source updates. It's up to the client to consume this event stream and keep the requested files up to date. After connecting and making the watch request, OpSync will be the first message received. Additionally, the OpSync event may be received at any point in the stream for various upstream reasons. OpUpdate and OpRemove are called when files must be updated or removed from the destination system.

Resources:

@SpencerSharkey
SpencerSharkey / main.rs
Last active June 5, 2022 22:54
iMessage Word Hunt solver weekend funtime
use std::{
collections::HashMap,
fs::File,
io::{BufRead, BufReader},
process::Command,
time::Duration,
};
use dbus::blocking::Connection;
use image::io::Reader as ImageReader;
@SpencerSharkey
SpencerSharkey / log1.txt
Created June 11, 2021 13:21
2 parallel plots
Multi-threaded pipelined Chia k32 plotter - 468cc5e
Final Directory: /plots/complete/
Number of Plots: 1
Process ID: 529185
Number of Threads: 40
Number of Buckets: 2^7 (128)
Pool Public Key: x
Farmer Public Key: x
Working Directory: /plots/fast/
Working Directory 2: /plots-ramdisk/
Multi-threaded pipelined Chia k32 plotter - 468cc5e
Final Directory: /plots-ramdisk/
Number of Plots: 1
Process ID: 2751553
Number of Threads: 80
Number of Buckets: 2^7 (128)
Pool Public Key:
Farmer Public Key:
Working Directory: /plots-ramdisk/
Working Directory 2: /plots-ramdisk/
@SpencerSharkey
SpencerSharkey / public-stage.ts
Created April 1, 2021 13:10
Pylon Public Stage Example
// Stage channels are here, and Pylon supports them!
// Here's an example that automatically invites users who "request to speak" to the stage.
// It also shows off the new iterVoiceStates function, and allows you
const logChannelId = '693184705805418578';
discord.on('VOICE_STATE_UPDATE', async (newState, oldState) => {
// Track voice state updates where a new member requests to speak.
if (
interface UserRole {
name: string;
roleId: discord.Snowflake;
}
// list of roles to give out
const USER_ROLES: Array<UserRole> = [
{
name: 'Minecraft',
roleId: '647793990753714176'
using System;
using System.Collections.Generic;
using System.Linq;
using Facepunch;
using Newtonsoft.Json;
using UnityEngine;
using Random = UnityEngine.Random;
namespace Oxide.Plugins
{
const TRIVIA_QUESTION_API =
'https://opentdb.com/api.php?amount=1&encode=url3986';
const TRIVIA_DB = new pylon.KVNamespace('trivia');
const TRIVIA_CMDS = new discord.command.CommandGroup();
const TRIVIA_LOCK_KEY = (
userId: discord.Snowflake,
channelId: discord.Snowflake
) => `lock:${userId}:${channelId}`;
use std::collections::HashMap;
use std::hash::Hash;
// Snowflakes
#[derive(Eq, PartialEq, Hash)]
pub struct Snowflake(pub u64);
impl From<u64> for Snowflake {
fn from(item: u64) -> Self {
Self(item)