<crystal-gh>
[crystal] potatogopher opened pull request #3496: Rename Contributing.md to CONTRIBUTING.md (master...patch-1) https://git.io/vXZSR
ome has quit [Quit: Connection closed for inactivity]
hako has quit [Read error: Connection reset by peer]
hako has joined #crystal-lang
jfontan has quit [Ping timeout: 260 seconds]
jfontan has joined #crystal-lang
pawnbox has joined #crystal-lang
ome has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter>
<sdogruyol> @redcodefinal congrats
pawnbox has quit [Remote host closed the connection]
no0p has quit [Quit: Leaving]
pawnbox has joined #crystal-lang
<FromGitter>
<phoffer> @sdogruyol I ran into an oddity with websocket routing that I’m not sure is a bug or just a limitation of `WebSocketHandler` being separate from `RouteHandler`… ⏎ I’m trying to have a sort of “subscription” web socket handler that looks like this: ⏎ ```code paste, see link``` ⏎ Is this a bug or just a limitation? It’s not a big problem, I’m just working through Kemal web socket prototyping and trying to fully
ome has quit [Quit: Connection closed for inactivity]
vikaton has quit [Quit: Connection closed for inactivity]
bjz has joined #crystal-lang
hako has quit [Ping timeout: 250 seconds]
Fichtenstein has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz has joined #crystal-lang
bjz has quit [Client Quit]
onionhammer has quit [Ping timeout: 256 seconds]
timeyyy has joined #crystal-lang
bjz has joined #crystal-lang
timeyyy_ has joined #crystal-lang
timeyyy has quit [Read error: Connection reset by peer]
timeyyy has joined #crystal-lang
timeyyy has quit [Read error: Connection reset by peer]
_timeyyy has joined #crystal-lang
_timeyyy has quit [Read error: Connection reset by peer]
onionhammer has joined #crystal-lang
timeyyy_ has quit [Ping timeout: 260 seconds]
mark_66 has joined #crystal-lang
sooli has joined #crystal-lang
DeBot has joined #crystal-lang
gloscombe has joined #crystal-lang
bjz has quit [Ping timeout: 250 seconds]
bjz_ has joined #crystal-lang
bjz_ has quit [Ping timeout: 252 seconds]
bjz has joined #crystal-lang
Philpax has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Fichtenstein has quit [Read error: Connection reset by peer]
Fichtenstein has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
<FromGitter>
<raydf> @redcodefinal nice lib :).
sustained has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
mark_66 has quit [Quit: Leaving.]
mark_66 has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sustained has quit [Remote host closed the connection]
sustained has joined #crystal-lang
shawn42 has joined #crystal-lang
dhk has joined #crystal-lang
sooli has quit [Ping timeout: 260 seconds]
<FromGitter>
<paulcsmith> @sdogruyol What kind of middlwares are you reusing and composing that are so helpful? Sounds super interesting, but I'm not entirely sure how you are using them
<FromGitter>
<sdogruyol> think of the request - response lifecycle going from up to down
<FromGitter>
<paulcsmith> Do you also use them for finding and assigning values? I've been trying to figure out how to use middleware for that, but it doesn't really seem possible/nice since you'd need to open up the HTTP context and add instance variables with optional types for the things you assign. Or maybe I just don't know how to do it
<FromGitter>
<paulcsmith> That is super cool looking
<FromGitter>
<paulcsmith> So does Middlewares::User load up a user and assign it to the context?
<FromGitter>
<sdogruyol> indeed
<FromGitter>
<sdogruyol> well not `User` but `user_id` in my case
<FromGitter>
<paulcsmith> Ohh would you mind sharing that middleware? I've been trying to figure out how to do something like that
<FromGitter>
<sdogruyol> because for now you can't store `Object`
<FromGitter>
<paulcsmith> Ohh ok that makes sense
<FromGitter>
<sdogruyol> hold on
<FromGitter>
<paulcsmith> So in the controller/action you still need to grab the actual record from the DB
<FromGitter>
<sdogruyol> and this middlewares are super testable
<FromGitter>
<sdogruyol> @paulcsmith yep
<FromGitter>
<sdogruyol> this is actually for existence
<FromGitter>
<paulcsmith> Cool :D Thanks for sharing @sdogruyol. Reminds me of plugs in Elixir
<FromGitter>
<paulcsmith> Kind of a bummer that records can't be assigned to the server context, but I don't think that could really be done :( Not a big deal though. A lot can be done in middleware as you showed
<FromGitter>
<sdogruyol> yeah
<FromGitter>
<paulcsmith> Pretty awesome
<FromGitter>
<sdogruyol> someone else also said the same
<FromGitter>
<sdogruyol> looked like plug
gloscombe has quit [Ping timeout: 260 seconds]
gloscombe has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter>
<redcodefinal> Hey guys, anyone have any experience with [stumpy_png](https://github.com/l3kn/stumpy_png)? I'm planning on writing some utilities on top of it, specifically for combining images, layering them one on top of the other, expansion, inflation etc. Wanted to hear if anyone here has any stumpy_png code they'd be willing to share.
gloscombe has quit [Quit: Lost terminal]
<BlaXpirit>
redcodefinal, i dont have much. but it's very simple, just pixels
<FromGitter>
<redcodefinal> @BlaXpirit neato thanks man
<BlaXpirit>
basically the only call i have is img[xx, yy].to_rgb8 lol
<FromGitter>
<redcodefinal> I am also having an issue with crystal being able to find stumpy. I put it into my shards.yml. I ran ```shards install``` and it downloaded ```stumpy_core``` and ```stumpy_png``` to the libs directory
<FromGitter>
<redcodefinal> However when using ```require "stumpy_png``` it says it can't find it.
<BlaXpirit>
redcodefinal, what directory structure
<BlaXpirit>
if your code is in src/ that may be it
<FromGitter>
<redcodefinal> yeah the code im running is in src
<BlaXpirit>
from my limited experience, i think itgoes to src only if it's a library
<FromGitter>
<redcodefinal> jeez you did a chipmunk implementation too, you are a busy dude
<FromGitter>
<redcodefinal> ah nice! not a bad solution
<FromGitter>
<redcodefinal> until windows support that is ;>
pawnbox has quit [Remote host closed the connection]
bmcginty_ has quit [Ping timeout: 250 seconds]
bmcginty has joined #crystal-lang
<RX14>
BlaXpirit, isn't the problem just that @redcodefinal is running crystal from src/ instead of the root?
<FromGitter>
<redcodefinal> @RX14 yes that was exactly the problem
<FromGitter>
<redcodefinal> I thought shards were global, to the project, not needing to be in the root
<RX14>
the chat log is pretty confusing...
vikaton has joined #crystal-lang
<FromGitter>
<redcodefinal> So I got a basic copy paste working but I noticed that it won't combine transparencies. anyone know any good way to combine the colors if one is transparent? ⏎ ``````
<BlaXpirit>
oh, you need that functionality? I didn't think it would be needed for making a ... collage
<BlaXpirit>
combining colors needs a non-obvious formula. that library doesn't do it
<FromGitter>
<phoffer> How do I copy a file from one location to another? I see `IO.copy`, and that `File` inherits that class method, but I must be missing something because I can’t get it to work
<Papierkorb>
I have to figure out a way to profile my code. Is there something better than having a profile{ .. } method which logs Time difference?
<BlaXpirit>
well there are generic profilers for llvm probably but that can get messy
<Papierkorb>
Oh that's interesting. Running the torrent client in release mode has no issues keeping up with stuff, while the default mode one uses constant 100% on busy torrents
<Papierkorb>
100% CPU time*
lacour has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter>
<redcodefinal> It's so weird having to think about the difference between compile time and run time after being in the interpreted world for so long
<FromGitter>
<redcodefinal> but so far I'm having a blast with Crystal
<BlaXpirit>
also typeof doesnt execute its argument
<FromGitter>
<redcodefinal> does it just take the last argument from the method for typeof
<BlaXpirit>
redcodefinal, no no, it's just that `p` returns its argument. and also the last expression is returned from the method
<FromGitter>
<redcodefinal> but it doesn't execute the method?
<BlaXpirit>
sorry for confusion
<BlaXpirit>
redcodefinal, it doesnt execute the method. it knows that with these types of arguments the method would've returned that type
Philpax_ has joined #crystal-lang
<FromGitter>
<redcodefinal> hmm thats neato
Philpax has quit [Ping timeout: 260 seconds]
<FromGitter>
<redcodefinal> When making a method that returns nothing, what data type do you use? Nil?
<BlaXpirit>
redcodefinal, yes. though people almost never write that a method returns : Nil
<FromGitter>
<redcodefinal> @BlaXpirit whys that? No need because of crystals inference?
vikaton has quit [Quit: Connection closed for inactivity]
<BlaXpirit>
redcodefinal, well there's never a need to specify any types in methods. it's all for type safety and documentation
<BlaXpirit>
and i guess people just find it weird to write : Nil
<Papierkorb>
I do it from time to time to make sure to not return anything, else a user might think that the result of that method is intentional and uses it and then their app breaks down the road or so
<Papierkorb>
for private methods I don't care, for some public methods I do care. Though I also tend to write out the (non-nil) return type explicitly if either 1) it's not obvious, so to help the reader 2) the code may be finicky so to make the compiler error out on code changes
<Papierkorb>
*bad code changes
<FromGitter>
<redcodefinal> Yeah I just like being explicit when dealing with types, I agree with @BlaXpirit about the fear of someone changing something down the road and then their stuff no longer works.