<FromGitter>
<codenoid> and, sir i have a question, how to show array data in crystal ? ,, (like print_r in php)
<FromGitter>
<lhz> `puts` should work fine
<FromGitter>
<codenoid> hmm, i want get "username" value from this variable ⏎ list = collection.find({ "username" => "suhu"})
<FromGitter>
<codenoid> as a single result (not each)
<FromGitter>
<codenoid> and my list variable just have 1 row documents (with username value)
zipR4ND has joined #crystal-lang
<FromGitter>
<lhz> what kind of object is `collection`? Enumerable#find would return a single object, so it's something else. how about `collection.find(...).first`?
bjz has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
<FromGitter>
<codenoid> well, i can "echo" that collection after do ⏎ `list.each do |payment|` ⏎ but ^ it for eaching data
<FromGitter>
<chuckremes> @eliasjpr No, the hooks do NOT work the same in Crystal as in Ruby. For example, in Ruby the `included` and `extended` hooks take an argument so you can operate on the class/module that did the include/extend call.
<FromGitter>
<chuckremes> In Crystal, you can get to some similar information via the `@type` ivar.
<FromGitter>
<chuckremes> I’ve started a wiki page to documents some tips & tricks for metaprogramming on Crystal. The include/extend hooks will be covered at some point. You can find it here:
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter>
<eliasjpr> nice! I actually like the fact you dont have to do the infamous `klass`
<FromGitter>
<schoening> Hurray my new/old MacBook pro has arrived. Never had a Mac before. I get homebrew now?
mark_66 has quit [Remote host closed the connection]
<FromGitter>
<fridgerator> yeah
<FromGitter>
<fridgerator> @schoening you'll also want to install xcode tools, even if you don't plan on using xcode
<RX14>
I vote install linux on it :)
<FromGitter>
<fridgerator> ^
<FromGitter>
<fridgerator> I have linux dual booted on mine, using a mac keyboard in linux is weird
<jfontan>
RX14, that's the smartest option
<FromGitter>
<schoening> It came with 500gb ssd so yeah I would like dual booting :) I'm impressed by the touchpad even tho it's from 2012 . Feels like a phone screen .
<BlaXpirit>
fridgerator, why would using a mac keyboard in linux be weird?
<BlaXpirit>
using a mac keyboard in mac is weird
<RX14>
mac keyboards are weird
<FromGitter>
<fridgerator> its hard to go back and forth, mac uses CMD+_ for things whereas pc uses CTRL+_ for things
<RX14>
well
<BlaXpirit>
that's the problem alright
<RX14>
my keyboard config is even weirder
<RX14>
i'm using an ANSI layout keyboard but a UK ISO layout in linux
<RX14>
so none of the symbols match
<RX14>
and the ANSI layout has 1 less key so my "start" button does \ and |
<FromGitter>
<fridgerator> and I tried just remapping the keys, but that just messes things up further
<BlaXpirit>
fridgerator, hate to spam this channel but i cant private message you. anyway. what i did was use Karabiner Elements to remap Fn to be another Cmd. and put Fn on whatever other key you don't use. old Karabiner (which doesnt work anymore) can do even better with some configuration
<RX14>
the channel's pretty empty so off-topic is fine
<RX14>
the only rule i'd say is don't interrupt on-topic with off-topic
<FromGitter>
<fridgerator> ok
<FromGitter>
<fridgerator> @BlaXpirit that would work for the macbook keyboard. The stanadlone keyboard though has the fn button up next to the home button
<FromGitter>
<fridgerator> I think my next laptop purchase (which wont be for a while) will definitely be a pc, I really don't like the new macbooks
<BlaXpirit>
fridgerator, so you're using standalone keyboard with a macbook?
<FromGitter>
<fridgerator> yes at work, because i'm plugged into a thunderbolt display with an external mouse and keyboard
<FromGitter>
<fridgerator> at home I just use the macbook
McSoFake has joined #crystal-lang
<wmoxam>
whoa, new release
<wmoxam>
will try an OpenBSD build tonight
<RX14>
wmoxam, re:openbsd, how easy would it be to get a box for CI purposes?
<wmoxam>
I'm not sure :p
<wmoxam>
RX14: I've had problems compiling directly on OpenBSD, have been cross-compiling
<RX14>
oh...
<RX14>
the compiler should work on openbsd
<wmoxam>
crystal compiler crashes when compiling crystal on OpenBSD
<RX14>
oh dear
<wmoxam>
:p
<wmoxam>
I haven't had issues compiling anything else though
<RX14>
weird
<RX14>
what was the error?
<wmoxam>
I'll have to check again
<wmoxam>
it possibly may not be an issue with the recent OpenBSD 6.1 release
<wmoxam>
😅
<wmoxam>
I feel like compiler releases have become much more solid recently
<wmoxam>
in the past a release would break a lot of things in the Liquid port that I've been working on
<wmoxam>
now it "just works"
<wmoxam>
specs pass, etc
<RX14>
if only we got new features...
<RX14>
i'm a little disappointed that there's nothing noteworthy in this release
<RX14>
I had hoped it would finally be the one for parallelism
<RX14>
with the branch coming along
<wmoxam>
I'm not really interested in parallelism tbh :p
<RX14>
me neither to be honest
<wmoxam>
am used to not having it in Ruby
<RX14>
but i'm interested for it as a step to 1.0
<RX14>
to finally get it in and fix the bugs
<RX14>
it's nearly may, and we have this rediculous goal of 1.0 before the end of the year. It seems madness to release 1.0 with less than 6 months production usage of a feature which touches so much
<BlaXpirit>
you're worrying about this as if it has any chance of happening
<RX14>
true
<FromGitter>
<codingphasedotcom> which is the best ORM
<FromGitter>
<codingphasedotcom> on crystal
<FromGitter>
<bew> I'd say: It's the one you build :P
<FromGitter>
<codingphasedotcom> yea lol
<FromGitter>
<codingphasedotcom> i was thinking of doing one
<FromGitter>
<bew> oh sorry, missed to read some comment..
<Renich>
RX14: I know it's a shard bug report, but it applies to crystal as well
<FromGitter>
<exts> Quick question: Is it bad practice when you build a crystal app project using shards cmd to write code outside the project module? I'm assuming that file+project module is treated like how some languages use a "main" function when compiled.
bjz has joined #crystal-lang
<RX14>
Renich, thats really weird
<Renich>
RX14: crazy stuff
<Papierkorb>
exts, I don't understand. Are you pointing the resulting binary outside of your project root dir (or child directories of it)?
<Papierkorb>
exts, if yes, that's not a good idea indeed. Your project only "owns" its directory, in which it may do as it pleases. It has no business outside of it though.
<Renich>
RX14: ah! wait, I just tried merging it and it worked! Maybe it was a related update (recent) to LLVM
<RX14>
merging which?
<Renich>
shards
<RX14>
what do you mean by merge
<Renich>
RX14: it's how us, Gentoons, say "install"
<Renich>
merging means building and installing
<FromGitter>
<exts> @PandaWhisperer no, i'm just wondering when you create a fresh project and it creates that default module file named after your app which is used as the default binary is it bad practice to write code outside that main namespace.
<RX14>
Renich, oh...
<Renich>
The repository ins git based and it's really cool. I can add patches on the fly as well.
<FromGitter>
<bew> @exts you mean Papierkorb I think ^^
<Renich>
RX14: it would be cool to fix this with a patch applied on the fly
<FromGitter>
<exts> oh sorry it messed up autocomplete,
McSoFake has quit [Quit: leaving]
<RX14>
one day i'll bother with gentoo
<RX14>
probably not actually
<FromGitter>
<exts> sorry @PandaWhisperer , wrong person :D
<Renich>
RX14: hehehe. If you do, you'll fall in love, my friend. Believe me. I was a Fedora maintainer and switched... Rolling release rocks
<RX14>
i'm on arch right now
<RX14>
rolling release is great
<Renich>
seems interesting. A lean linux
<RX14>
yeah
<Renich>
RX14: yep, it rocks. Arch is amazing as well
<Papierkorb>
exts, ah, now I understand. If it's an *application*, I wouldn't say it's bad practice. Though I mostly have a "X_bin.cr" (or similar) file, which then uses `MyApp::Tool.run ARGV` to jump into the front-end CLI handling code. This is especially nice if your application may end up as being useful as library too. It also saves you the headache of not writing `MyApp::` everywhere. Apart from that, it's acceptible I think
<Renich>
I'll see if I can fix it myself and deploy it
<FromGitter>
<exts> ah thanks @Papierkorb (gitter doesn't want to autocomplete your name for some reason)
<RX14>
thats really cool Renich
<RX14>
damn i should try gentoo
<Papierkorb>
exts, I'm on IRC, that's probably why ;)
<RX14>
i havent reinstalled in... years
<Renich>
LOL. Well, if you do, let me know if you need any help.
<FromGitter>
<exts> ah
<RX14>
Renich, this FS was created jun 23 2014
<RX14>
so prettty old arch install
<RX14>
i need to start from scratch :)
<Renich>
wow. Yeah. Are you using systemd?
<RX14>
remove all the stuff I don't use any more
<RX14>
Renich, yeah
<Papierkorb>
Though I also sometimes end up tabbing the nick just to be reminded that no, the correct recipient is on gitter and I just annoyed some random internet user instead :)
<Renich>
cool
<Renich>
RX14: well, you could try gentoo, check it out, and go back to a fresh arch install.
<RX14>
Renich, systemd is cool, all the bloat around it isn't
<Renich>
I mean, it will take some time to get right, but I have a script I've used for my workstation. Maybe it could help you, if you decide
<RX14>
one day i'll write my own init in crystal which is basically a stripped down systemd...
<FromGitter>
<exts> lol yeah, that's what I just did a second ago :)
<Renich>
RX14: I love systemd. I feel it gets deminished every time they hatters hate it. It is not just an init system.
<Renich>
RX14: cool!
<RX14>
i don't love systemd
<RX14>
it's way better than sysv
<RX14>
but it's bloated and does much more than it should
<RX14>
especially the networking stuff
<RX14>
i endeded up ripping that out and using connman
<RX14>
also why on earth does it even have a bootloader
<RX14>
it's just silly
<Renich>
well, it makes thing standardized accross distros, which is really cool. I don't like the fact that we are segmented as hell.
<Renich>
yeah, I get your point
<RX14>
making init scripts for daemons standard is good, but networking? nah
<Renich>
RX14: well, if it gets good, I would go for it. I use NetworkManager for now. With bonding and stuff
<RX14>
i think runit is pretty cool though
<RX14>
having seen it in practice
<Renich>
RX14: hey man, if I put the workaround in compiler/stdout.cr (doesn't exist) you think it would be enough? I mean, wrap it in module Crystal and stuff
<RX14>
Renich, probably?
<Renich>
well, I'd, definitely, test a crystal init ;)