Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:49
    HertzDevil labeled #11554
  • 13:49
    HertzDevil labeled #11554
  • 13:49
    HertzDevil labeled #11554
  • 13:49
    HertzDevil opened #11554
  • 13:23
    HertzDevil labeled #11505
  • 13:23
    HertzDevil labeled #11505
  • 12:25
    straight-shoota edited #11177
  • 12:24
    straight-shoota milestoned #11211
  • 11:31
    HertzDevil labeled #11553
  • 11:31
    HertzDevil labeled #11553
  • 11:31
    HertzDevil labeled #11553
  • 11:31
    HertzDevil opened #11553
  • 11:23
    HertzDevil labeled #11552
  • 11:23
    HertzDevil labeled #11552
  • 11:23
    HertzDevil opened #11552
  • 11:08
    straight-shoota closed #11475
  • 10:16
    straight-shoota closed #9647
  • 10:16
    straight-shoota edited #9647
  • 10:12
    straight-shoota demilestoned #11230
  • 10:07
    straight-shoota milestoned #11094
Chris Watson
@watzon
@rishavs VS Code currently has the best Crystal support. It's not stellar, but that's more a lack of a decent language server than anything.
From IRC (bridge bot)
@FromIRC
<ua_> he waited whole 6.5 minutes lmao
George Dietrich
@Blacksmoke16
hm?
From IRC (bridge bot)
@FromIRC
<ua_> i mean Guest12
<ua_> and he should just use react / react native if anyone cares about answer to his question lol
Daniel Worrall
@Daniel-Worrall
Oh, did he leave the irc?
From IRC (bridge bot)
@FromIRC
<ua_> no html/css sure, sadly its the world we live in
Chris Watson
@watzon
He said he didn't want to touch HTML/CSS
From IRC (bridge bot)
@FromIRC
<ua_> yeah
Chris Watson
@watzon
Flutter is the way imo
Daniel Worrall
@Daniel-Worrall
Flutter is nice
Rishav Sharan
@rishavs
flutter is indeed his best bet
George Dietrich
@Blacksmoke16
just return JSON
who needs a UI
Chris Watson
@watzon
++
UIs are for chumps
George Dietrich
@Blacksmoke16
ascii art formatted tables
Chris Watson
@watzon
Just emulate VIM
Rishav Sharan
@rishavs
just hire mimes to read the json and act on it
aaaScript
@aaaScript

@aaaScript Empty @sockets explains why close doesn't work. p @sockets before & after bind & listen(). The array probably gets nuked after listen or it wouldn't accept connections at all

@didactic-drunk It returns socket output after bind_tls and listen as expected. However, it just seems to get wiped like you mentioned. It's kind of weird. I'm not overwriting the object or anything.

ddd
@Dan-Do
@Guest12 you can try Mint
Quinton Miller
@HertzDevil
libpcre reached end-of-life
Ali Naqvi
@naqvis
log back ago, I commented to migrate to pcre2, but ...
https://github.com/crystal-lang/crystal/issues/8199#issuecomment-533171075
Alex Kampa
@alex-kampa
h = Hash(String, String | Hash(String, String)).from_json(jmsg)

results in a compile-time type of

(Hash(String, Hash(String, String) | String) | Nil)

which measn that h.keys throws an error. How can I force h to be a hash?

ie never Nil
Is using is_a? the only way?
George Dietrich
@Blacksmoke16
where is the nil coming from?
Alex Kampa
@alex-kampa

So I simply added this to convince the compiler:

h = h.nil? ? Hash(String, String | Hash(String, String)).new : h

I would guess the nil is because the initial "h = ..." assignment is inside a begin rescue end

Daniel Worrall
@Daniel-Worrall
Yes, you need to compile time check nil.
You can do h ? not_nil_here : nil_here
which is shorthand for if h etc.
This works since it is truthy when not nil
I'm unsure how this works with compile type of Bool | Nil, but I guess it would be true only in the first branch and false | nil in the second
George Dietrich
@Blacksmoke16
what do you have in the rescue portion tho?
sounds like you're just not handling the case where an exception is raised
Ali Naqvi
@naqvis
@alex-kampa For your specified use-case, i would suggest to go with JSON::Serializable and create a general class, which consumes any json string and returns Hash representation.
https://play.crystal-lang.org/#/r/bf2g
Daniel Worrall
@Daniel-Worrall
While recommendations are appreciated, the nilable hash and original has nothing to do with that. fyi
Chris Watson
@watzon
You know how in Crystal you can use a generic like T and then use T.class to say that you want the class rather than an instance of that class? Any idea how to accomplish the same in Typescript?
Gabor Szabo
@szabgab
I have been lurking here for a while, but I guess I should say hi, before I start asking questions. I have been learning Crystal in the last couple of weeks. I started to create a web site collecting data about shards, but then straight-shoota pointed at his shardbox an already existing (and much better looking) system. We then had a live coding session in which he explained about the shardbox and then we even created a small change. Anyway, I keep learning Crystal and I guess I'll ask some questions here. I hope it is ok even though they will be probably very basic.
George Dietrich
@Blacksmoke16
o/
Chris Watson
@watzon
Welcome @szabgab
Benjamin Clos
@ondreian
is everyone just using minimal Travis image these days since the language: crystal doesn't work?
George Dietrich
@Blacksmoke16
pretty no one is using travis anymore and just switched to GH Actions
From IRC (bridge bot)
@FromIRC
<jhass> or whatever else, just stopped using travis. They got bought out and basically none of the original open source folks is there anymore
Benjamin Clos
@ondreian
I see. crystal init still generates a .travis.yml file
George Dietrich
@Blacksmoke16
it wont starting next release
Benjamin Clos
@ondreian
cool deal, it had been awhile since I needed to init a new project but was kind of :corn: fused about what was going on. Thanks.
Gabor Szabo
@szabgab
@ondreian , there is this nice form that helps generating a minimal config file for GitHub Actions: https://crystal-lang.github.io/install-crystal/configurator.html
From IRC (bridge bot)
@FromIRC
<straight-shoota> Great to have you here, szabgab =)
Rishav Sharan
@rishavs
Has anyone here used google sign in for their sites? Would you know what "data-nonce" is?
Is it the secret string that we need to match with the google response to make sure it is our own request?