I hereby claim:
- I am z64 on github.
- I am z64 (https://keybase.io/z64) on keybase.
- I have a public key whose fingerprint is E06F 6AC5 00E3 1D33 0DA7 6404 2CD1 AA8E 1137 87ED
To claim this, I am signing this object:
| require "json" | |
| # Optimized implementation of a fixed sized ring buffer that exposes | |
| # a simple and "safe" API of `#push` and `#to_a`. `#push`ing to a full | |
| # buffer erases the oldest member. | |
| # | |
| # ``` | |
| # # Create a new buffer of Int32, with size 3 | |
| # buffer = StaticRingBuffer(Int32, 3).new | |
| # buffer.push(1) |
| # Encode a time into a snowflake with the given worker ID | |
| def snowflake(time, worker) | |
| value = time.epoch_ms << 22 | |
| value | worker | |
| end | |
| # Decode a snowflake into a named tuple of its components | |
| def decode(snowflake) | |
| {time: Time.epoch_ms(snowflake >> 22), worker: snowflake & 0b1111} | |
| end |
| module Powerbot | |
| module DiscordEvents | |
| module Spong | |
| extend Discordrb::EventContainer | |
| CHANNELS = [ | |
| 226941225339584513, | |
| 225375815087554563 | |
| ] |
| @[Flags] | |
| enum Method | |
| None | |
| Get | |
| Post | |
| Put | |
| Patch | |
| Delete | |
| end |
I hereby claim:
To claim this, I am signing this object:
| require "json" | |
| require "yaml" | |
| require "./string_converter" | |
| data = {test: "1", value: "3.5"} | |
| json_data = data.to_json | |
| yaml_data = data.to_yaml | |
| class Data |
This post has been moved to my org's blog.
| #Install libsodium (python3-nacl and libsodium-dev worked for me), libopus (libopusfile0 and libopus0 worked for me), ffmpeg | |
| #Install https://github.com/rg3/youtube-dl | |
| require 'discordrb' | |
| $isplaying = 0 | |
| bot = Discordrb::Commands::CommandBot.new token: token, client_id: clientid, prefix: '.' | |
| bot.command(:play) do |event, songlink| | |
| if $isplaying == 1 | |
| event.message.delete | |
| event.respond 'Already playing music' | |
| break |
This is a compiled list of Pristine rings across the galaxy as reported in EDDB, as of the date of this file.
The distance to that power's HQ is listed in parenthesis.