ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.32.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
alex`` has quit [Ping timeout: 268 seconds]
alexherbo2 has quit [Ping timeout: 268 seconds]
ur5us has joined #crystal-lang
hightower2 has quit [Ping timeout: 265 seconds]
Human_G33k has quit [Ping timeout: 268 seconds]
ur5us has quit [Ping timeout: 265 seconds]
Human_G33k has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> @Blacksmoke16 which languages
<FromGitter> <ImAHopelessDev_gitlab> i use parentheses all the time. passing arguments to a method with spaces breaks readable, and looks like an English sentence
<FromGitter> <spTorin> What name of platform under android `termux`? Exists any project to compile crystal program under termux?
_whitelogger has joined #crystal-lang
_ht has joined #crystal-lang
<FromGitter> <grkek> @ImAHopelessDev_gitlab man of culture I see
teardown has quit [Ping timeout: 268 seconds]
<FromGitter> <ImAHopelessDev_gitlab> :D
_ht has quit [Quit: _ht]
ur5us has joined #crystal-lang
<FromGitter> <j8r> Hum parentheses in english are only for optional information
<FromGitter> <j8r> Like most other languages
<FromGitter> <j8r> If there is method + one argument, without spaces, its closer to standard english sentences (like `puts myword`)
teardown has joined #crystal-lang
ur5us has quit [Ping timeout: 265 seconds]
<FromGitter> <Daniel-Worrall> Yeah, the optional paren style from ruby is due to the human readable nature of it
f1refly has quit [Ping timeout: 268 seconds]
alexherbo2 has joined #crystal-lang
alex`` has joined #crystal-lang
<FromGitter> <636f7374> Hi, have you tried making a VPN with Crystal? I recently discovered a TUNTAP (https://github.com/Papierkorb/tuntap) Crystal shard.
<FromGitter> <636f7374> Making a VPN with Crystal should be fun.
<FromGitter> <636f7374> Use VPN as a local loopback.
<FromGitter> <pynixwang> this is low level
f1refly has joined #crystal-lang
<FromGitter> <636f7374> Yes, this is a bit difficult, I decided to implement SOCKS5 first. :)
erdnaxeli has quit [*.net *.split]
alex`` has quit [*.net *.split]
teardown has quit [*.net *.split]
FromGitter has quit [*.net *.split]
Yxhuvud has quit [*.net *.split]
DTZUZU has quit [*.net *.split]
oprypin has quit [*.net *.split]
dom96 has quit [*.net *.split]
beepdog has quit [*.net *.split]
jhass has quit [*.net *.split]
asterite has quit [*.net *.split]
gangstacat has quit [*.net *.split]
Flipez has quit [*.net *.split]
sorcus has quit [*.net *.split]
blueberrypie has quit [*.net *.split]
hpyc9 has quit [*.net *.split]
dostoyevsky has quit [*.net *.split]
davic has quit [*.net *.split]
woodruffw has quit [*.net *.split]
confact has quit [*.net *.split]
chachasmooth has quit [*.net *.split]
alex` has joined #crystal-lang
alex` is now known as Guest34893
Guest34893 is now known as alex``
dom96 has joined #crystal-lang
olbat[m] has quit [*.net *.split]
jhass has joined #crystal-lang
beepdog has joined #crystal-lang
asterite has joined #crystal-lang
erdnaxeli has joined #crystal-lang
f1refly has quit [*.net *.split]
MasterdonX has quit [*.net *.split]
fifr has quit [*.net *.split]
Seich has quit [*.net *.split]
blackbeard420 has quit [*.net *.split]
Stephie has quit [*.net *.split]
mjblack has quit [*.net *.split]
edr has quit [*.net *.split]
jrayhawk has quit [*.net *.split]
alex`` has quit [Client Quit]
DTZUZU has joined #crystal-lang
teardown has joined #crystal-lang
FromGitter has joined #crystal-lang
Yxhuvud has joined #crystal-lang
oprypin has joined #crystal-lang
blueberrypie has joined #crystal-lang
woodruffw has joined #crystal-lang
gangstacat has joined #crystal-lang
hpyc9 has joined #crystal-lang
sorcus has joined #crystal-lang
dostoyevsky has joined #crystal-lang
davic has joined #crystal-lang
confact has joined #crystal-lang
chachasmooth has joined #crystal-lang
Flipez has joined #crystal-lang
edr has joined #crystal-lang
dostoyevsky has quit [Max SendQ exceeded]
Seich has joined #crystal-lang
jetpack_joe has quit [Ping timeout: 245 seconds]
Liothen has quit [Ping timeout: 246 seconds]
fifr has joined #crystal-lang
blackbeard420 has joined #crystal-lang
f1refly has joined #crystal-lang
jetpack_joe has joined #crystal-lang
MasterdonX has joined #crystal-lang
jrayhawk has joined #crystal-lang
Liothen has joined #crystal-lang
alex` has joined #crystal-lang
<alex`> Hi
alex` is now known as Guest25912
<Guest25912> How to avoid namespace conflicts with proc?
Guest25912 is now known as alex``
<alex``> Error: undefined method 'split' for Nil (compile-time type is (String | Nil))
<alex``> I have set `text` L1, then defined a proc `handler` which use `text = blabla`
<alex``> I want my `text` in `handler` not be related to the `text` out of the scope
<alex``> I had to rename `text` in handler to `string` or something
<alex``> to fix the compilation
Stephie has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
<FromGitter> <Nicolab> Hello
<FromGitter> <Nicolab> Crystal has goto statement?
<FromGitter> <Nicolab> Like: ⏎ ⏎ ```label: ⏎ ⏎ // ... ⏎ ⏎ goto label``` [https://gitter.im/crystal-lang/crystal?at=5e39661558f02e34976153c6]
<FromGitter> <j8r> no, for what purpose?
<FromGitter> <j8r> It can encourage bad designs
<FromGitter> <j8r> and practices
<alex``> I have time difference between crystal and my system data
<alex``> $ date '+%s' # 1580820599 (13:50)
<alex``> Time.unix(1580820599) # 12:50
<alex``> https://crystal-lang.org/api/0.32.1/Time.html#unix(seconds:Int):Time-class-method
<alex``> how can I make it count the +01:00 ?
<alex``> to honor my system date
<FromGitter> <Blacksmoke16> @ImAHopelessDev_gitlab php, js, and ts are the big ones
<FromGitter> <straight-shoota> `date` formats the time in your system's time zone, while `Time.unix`creates a `Time` instance in UTC.
<alex``> how can I fix the time diff?
<alex``> I rely on `date` for the input
<FromGitter> <straight-shoota> Time#to_local
<FromGitter> <straight-shoota> or Time.in(whatever_timezone_you_want)
<alex``> thanks!
<FromGitter> <straight-shoota> Why shell out to `date` though?
<alex``> straight-shoota for the parsing
<alex``> at some point I might do my own parser but for now `date` is quite satisfying
<FromGitter> <straight-shoota> What can it do that `Time::Format` can't?
<alex``> guessing dates
<FromGitter> <straight-shoota> ?
<alex``> $ date --date 'tomorrow' '+%s'
<FromGitter> <straight-shoota> Ah yes. That's not guesswork though, just parsing natural language.
<FromGitter> <straight-shoota> Yeah Stdlib probably won't provide that to avoid i18n complexity.
<FromGitter> <straight-shoota> A shard with that functionality would be very welcome =)
<alex``> I will do
<alex``> I'm exploring a way to do GTD
<alex``> and the key missing feature from Org-mode is to manipulate dates
<alex``> will record a video
<alex``> do you think it is ugly to use `date`?
<alex``> as a first draft
<alex``> (my end goal currently is to create a command-line that play nicely with text editors)
<FromGitter> <straight-shoota> It's certainly not very efficient, but as long as there's no native implementation it's certainly okay to resort to `date`
<livcd> Is there any gtk app in Crystal ?
<FromGitter> <Nicolab> @Blacksmoke16 OK thanks. Just to know if there's
<FromGitter> <Blacksmoke16> hm?
<FromGitter> <Nicolab> @Blacksmoke16 Oops sorry
<FromGitter> <Nicolab> I was mistaken
<FromGitter> <Nicolab> It's for @j8r
chachasmooth_ has joined #crystal-lang
chachasmooth has quit [Ping timeout: 272 seconds]
<FromGitter> <andrewc910> Is it possible to hook into the a method? IE: You include a module into your model. That module hooks into the middle of a controller
<FromGitter> <Blacksmoke16> probably not how you're thinking?
<FromGitter> <Blacksmoke16> could do like
<FromGitter> <Blacksmoke16> ```if self.is_a? SomeModule ⏎ run_the_method ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5e399d24ea9ba00b84af7d78]
<FromGitter> <tenebrousedge> hmmm....what about...
<FromGitter> <andrewc910> Hmm, not what I am looking for. Would hooking into method_missing an suppressing the error if it was invoked by a certain method be a code smell?
<FromGitter> <Blacksmoke16> what are you trying to do?
<FromGitter> <tenebrousedge> most uses of `method_missing` are a code smell
<FromGitter> <andrewc910> Im looking at adding "controllers" to contrive similar to devise. Your "user_controller" would inherit from `Contrive::Controllers::UserController`. Well, I have 1 method `update_tracked_fields`thats only available if you mixin the trackable module. I am trying to find a way to include this method invocation in my controller without the method missing error.
<FromGitter> <Blacksmoke16> OOP way would be for the parent to implement some common logic that calls an abstract def on the child
<FromGitter> <Blacksmoke16> but i dont think that fits super well here since they are routes and various HTTP methods
<FromGitter> <Blacksmoke16> could this be like an `HTTP::Handler` or something?
<FromGitter> <Blacksmoke16> or implement some before/after hook that is based on if the module is included?
<FromGitter> <andrewc910> The last thing is literally what I'm trying to do!
<FromGitter> <andrewc910> If "UserController#create" is invoked, and is successful, and this module is mixed in, do this
<FromGitter> <andrewc910> Omg, here I am looking at crystal documentation and Amber has a solution.
<FromGitter> <andrewc910> Thank you man!
<FromGitter> <andrewc910> Now how do you check if a module is included?
<FromGitter> <Blacksmoke16> granted ofc it kinda prevents it from being used outside of amber
<FromGitter> <Blacksmoke16> versus being more generic
<FromGitter> <Blacksmoke16> `if self.is_a? Trackable`
<FromGitter> <andrewc910> Well my controllers inherit from Amber so this works. The lib can still be used without amber. Just can't use these specific controllers.
<FromGitter> <Blacksmoke16> probably fine
<FromGitter> <andrewc910> Thank you again @Blacksmoke16 always appreciate the help 😁
<FromGitter> <Blacksmoke16> np
_ht has joined #crystal-lang
<FromGitter> <Blacksmoke16> whoa, looks like i got some competition in the DI space now https://github.com/jerometwell/hardwire
<FromGitter> <Blacksmoke16> i thought that looked familiar
<FromGitter> <Blacksmoke16> think it would suffer from the issue the other ones have tho, since it operates on the class level
ternarysolo has joined #crystal-lang
erdnaxeli has quit [*.net *.split]
beepdog has quit [*.net *.split]
asterite has quit [*.net *.split]
jhass has quit [*.net *.split]
erdnaxeli has joined #crystal-lang
asterite has joined #crystal-lang
beepdog has joined #crystal-lang
jhass has joined #crystal-lang
baweaver has quit [Ping timeout: 268 seconds]
baweaver has joined #crystal-lang
<FromGitter> <636f7374> #8744
<DeBot> https://github.com/crystal-lang/crystal/issues/8744 (HTTP::Client::Response.cookies Invalid Int32 (ArgumentError))
sorcus has quit [Quit: WeeChat 2.7]
ur5us has joined #crystal-lang
sorcus has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
_ht has quit [Quit: _ht]
ur5us has quit [Ping timeout: 265 seconds]