profile
viewpoint
Chris Watson watzon Senior Software Engineer Utah, USA https://watzon.tech Freelance web and software developer; lover of all things open source.

Crecto/crecto 341

Database wrapper and ORM for Crystal, inspired by Ecto

cadmiumcr/cadmium 199

Natural Language Processing (NLP) library for Crystal

Crecto/crecto-admin 31

Crecto Admin

crystal-term/screen 14

Cross platform terminal screen detection

hydecr/strange 11

A powerful logger for those that need a little something more

crystal-term/cursor 9

Terminal cursor movement and manipulation of cursor properties such as visibility

protoncr/crypto 8

Pure Crystal implementations of various Cryptography algorithms

startedFictiverse/Redream

started time in 2 days

startedsmol-ai/developer

started time in 6 days

startedsqueek502/resinator

started time in 6 days

startedOrchardCMS/OrchardCore

started time in 13 days

issue openedpyr0ball/PRbL-bashrc

Zsh support/missing .bashrc.d directory

I use ZSH as my shell, but the Slipstream installer expects you to be using bash and have an existing ~/.bashrc.d directory. If you don't, it breaks.

I also have python and pip, but they're installed using asdf and not the package manager, so it thinks I'm missing pip. Could be good just to check if the binary is available on the path rather than checking the package manager. Would also likely be less code.

created time in 13 days

push eventprotoncr/tourmaline

Chris Watson

commit sha f8de7f681869eace3074a36095c6e7420082131d

Fix formatting

view details

push time in 16 days

issue closedprotoncr/tourmaline

Manual polling feature

Add method in Tourmaline::Poller to manually poll updates. It can be useful if you want to do other events in main loop (because I don't understand Crystal concurrency yet and I didn't find other way to do other things while bot is running).

I did it such way in my code but I have no time to make proper PR

# Modification of Tourmaline::Poller with manual poll feature
require "tourmaline"

module Burservis
  class PollingNotStarted < Exception; end

  # The `Poller` class is responsible for polling Telegram's API for updates,
  # and then passing them to the `Dispatcher` for processing.
  class Poller
    Log = ::Log.for(self)

    getter offset : Int64

    def initialize(client : Tourmaline::Client)
      @client = client
      @offset = 0_i64
      @polling = false
    end

    def poll
      if !@polling
        raise PollingNotStarted.new("Polling is not started")
      end

      updates = @client.get_updates(offset: offset, timeout: 30)
      updates.each do |update|
        @client.dispatcher.process(update)
        @offset = Int64.new(update.update_id + 1)
      end
    end

    # Starts polling Telegram's API for updates.
    def start(manual_poll : Bool?)
      @client.delete_webhook
      Log.info { "Polling for updates..." }
      @polling = true

      if !manual_poll
        while @polling
          poll
        end
      end
    end

    def stop
      @polling = false
    end
  end
end

also could be nice to make poller getter in Client

closed time in 16 days

Rorkh

issue commentprotoncr/tourmaline

Manual polling feature

Solved in 65ceaa5515a9e5a57a497f27c0f4bbaa2929de86

Rorkh

comment created time in 16 days

push eventprotoncr/tourmaline

Chris Watson

commit sha 65ceaa5515a9e5a57a497f27c0f4bbaa2929de86

Refactor poller module to extract poll_and_dispatch method. Improves code readability and maintainability.

view details

push time in 16 days

issue commentprotoncr/tourmaline

Manual polling feature

So the whole reason behind making the Poller and Server classes was so that they could be used and modified outside of the context of the Client itself. Both are also just pretty thin wrappers around Telegram API actions. In the case of the Poller, that's client.get_updates.

That being said I can definitely split the poll method into multiple methods so that you can poll for a single update manually. I won't be adding a getter to the Client class though, because you can just as easily create a Poller manually.

client = Tourmaline::Client.new(...)
poller = Tourmaline::Poller.new(client)

# ...
Rorkh

comment created time in 16 days

startedhugopl/tijolo

started time in 20 days

startedhendricius/the-sourdough-framework

started time in 20 days

created tagwatzon/pixie

tagv0.3.0

Making magic with Crystal and images (using ImageMagick)

created time in a month

release watzon/pixie

v0.3.0

released time in a month

delete tag watzon/pixie

delete tag : v0.3.0

delete time in a month

push eventwatzon/pixie

Chris Watson

commit sha 6b150a56c6d225ff80b4b0f8a05acd78d467c2e6

v0.3.0 bump

view details

push time in a month

created tagwatzon/pixie

tagv0.3.0

Making magic with Crystal and images (using ImageMagick)

created time in a month

release watzon/pixie

v0.3.0

released time in a month

fork watzon/shrine.cr

File Attachment toolkit for Crystal applications. Heavily inspired by Shrine for Ruby.

https://jetrockets.github.io/shrine.cr/

fork in a month

push eventwatzon/pixie

Chris Watson

commit sha b9f001e9ab2ce7e18fb210caf8e4628ac8adb264

fix a couple things

view details

push time in a month

push eventwatzon/pixie

Chris Watson

commit sha 8be271b0a35a22dde4ca17ecd1bfb2f997ac9368

fix a couple of things broken due to find and replace

view details

Chris Watson

commit sha 9f9522fce1301257a4fa173d614a4512584e5c2a

fix some bugs, add more helpful methods

view details

push time in a month

startedopenai/shap-e

started time in a month

push eventwatzon/pixie

Chris Watson

commit sha 3c3cda0623b9da962bdd987b26ce2fa8619dfcf8

fix readme

view details

push time in a month

push eventwatzon/pixie

Chris Watson

commit sha 48f0e49dc51dc822714ee6aa474f3de3c6201717

fix action=

view details

push time in a month

startedSoftCreatR/imei

started time in a month

PR opened shardbox/catalog

Add pixie
+2 -0

0 comment

1 changed file

pr created time in a month

push eventwatzon/catalog

Chris Watson

commit sha f84407f52c728d279b3888e7d796fe754c96ecd9

add pixie

view details

push time in a month

fork watzon/catalog

The shard catalog for shardbox.org

https://www.shardbox.org/

fork in a month

push eventwatzon/pixie

Chris Watson

commit sha 0b5c749de6e94267ab2343f9fc1a09e60c9ace9e

Create crystal.yml

view details

push time in a month

created tagwatzon/pixie

tagv0.2.0

Making magic with Crystal and images (using ImageMagick)

created time in a month

more