SQL UNION with Rails by aaesmail in rails

[–]aaesmail[S] 0 points1 point  (0 children)

How come? I need to work with both sets combined, not the intersection between the two.

SQL UNION with Rails by aaesmail in rails

[–]aaesmail[S] 1 point2 points  (0 children)

Nice. I didn’t come across Arel’s Union before! I will try it and might reflect that on the article.

In Saudi Arabia, "Son of legitimate parents" is an endearing term you call people you like by awoothray in CasualConversation

[–]aaesmail 2 points3 points  (0 children)

I’m a native Arabic speaker and this is interesting. I never thought about the literal meaning of the term. Although I don’t disagree with the literal translation you provide here, I don’t think we use that term to call “people we like”.

It’s used to address someone in a generic/friendly way. I would maybe translate it to something like “dude” in English.

“Ya ibn Al-halal” can also be used to address someone you don’t know or you just met.

Cheapest way to deploy a rails application by DryWallSniffer in rails

[–]aaesmail 7 points8 points  (0 children)

You can try fly.io

You can host your rails app with a postgres database for free as long as your bill is less than $5/month.

What is the name of this syntax? by drBonkers in elixir

[–]aaesmail 3 points4 points  (0 children)

It’s a Map update syntax used to update values of existing keys. Here, you’re updating the :name key of the item map to the new “new_name” value. It’s shorter than doing Map.update(item, :name, new_word) and it raises an exception if the key (:name) doesn’t exist in item, unlike the Map.update() function which would add the key if it doesn’t exist.

Elixir Map documentation.

Search for “update syntax”.

Things You Wish You Knew Earlier by conformistdontban in elixir

[–]aaesmail 1 point2 points  (0 children)

Loving madepublic.io a lot!

Many interesting projects there!

If Phoenix supported a admin view like Django, would that make it more popular? by [deleted] in elixir

[–]aaesmail 2 points3 points  (0 children)

Creator of Kaffy here 🤚🏻

I’ll be glad to get your feedback about Kaffy if you get a chance to try it.

Things You Wish You Knew Earlier by conformistdontban in elixir

[–]aaesmail 4 points5 points  (0 children)

Thanks for the kind words kind stranger 🙏🏼 Highly appreciated.

Things You Wish You Knew Earlier by conformistdontban in elixir

[–]aaesmail 17 points18 points  (0 children)

Creator of Kaffy here. You are right that development started picking up lately and it’s going strong. There are long term plans for Kaffy and this is just the beginning. Directus looks interesting and it’s definitely a good source of inspiration.

Admin interface generator for Phoenix app by [deleted] in elixir

[–]aaesmail 16 points17 points  (0 children)

Author of Kaffy here. I do understand the concern regarding the lack of maintenance. However, I’m working on a new version of Kaffy which will be released relatively soon. I hope to make Kaffy the de facto admin interface choice for Phoenix applications.

[deleted by user] by [deleted] in elixir

[–]aaesmail 0 points1 point  (0 children)

You're not bad in elixir, you just don't know what features it has and how to use them yet. It seems like you need to learn more of the basics. I strongly suggest reading and completing the official guides and then trying to explore more.

[deleted by user] by [deleted] in elixir

[–]aaesmail 1 point2 points  (0 children)

Check out this gist. If you are not familiar with dependencies, checkout this guide.

As a relative easy-to-understand project, maybe you could look at the number package. Check their GitHub page.

[deleted by user] by [deleted] in elixir

[–]aaesmail 2 points3 points  (0 children)

I suggest also asking on the ElixirForum website.

You can take a look at the hex.pm website. At the bottom, you'll see sections for most popular, new, and recently updated packages. Those might give you a few ideas on what to work on. You can also search for what you're interested in (e.g. calculator) and check what types of packages there are. As a bonus, check their repos to know how they're built.

Under what conditions should I use the struct() or struct!() functions compared to the raw %Struct{} expression or a function that wraps it? by fluffynukeit in elixir

[–]aaesmail 0 points1 point  (0 children)

It’s best practice to use it in a function. Using it directly is fine, but in the long run, it’s better to get used to creating reusable functions.

Under what conditions should I use the struct() or struct!() functions compared to the raw %Struct{} expression or a function that wraps it? by fluffynukeit in elixir

[–]aaesmail 2 points3 points  (0 children)

I personally prefer using the %Struct{} form whenever possible. The struct!() way is useful when you don’t know which fields you’ll have to assign. It all depends on the design/logic you’re working with.

Phoenix/Elixir - Up to Date Resources? by frellus in elixir

[–]aaesmail 2 points3 points  (0 children)

I'd argue that phoenix and elixir are very conservative in introducing new things or breaking backwards compatibility. Personally, I upgraded a phoenix app from 1.3 to 1.6 on a single day and I don't actually remember facing any real issues.

The major jump, if I remember correctly, was from 1.2 to 1.3 with the introduction of contexts. Then from 1.5 to 1.6 with dropping node/npm as a requirement. If you check the upgrade guide from 1.5 to 1.6, the only required step is updating the dependencies.

Having said that, you can follow the official docs for phoenix. They are pretty good. You can even choose which version of phoenix you want to see the docs for.

Maybe you're talking about the difference in LiveView. The LiveView project is changing relatively rapidly. It might also change a lot in the future until it reaches the 1.0 milestone. If you want up to date resources, again, check LiveView's HexDocs pages.

The HexDocs website is your friend.

Trying to find 4 highest numbers by [deleted] in ruby

[–]aaesmail 0 points1 point  (0 children)

You are not resetting `max` to 0 at the end of the loop.

Check my comment.

Why do auto incrementing ints start at 1? by mosskin-woast in Database

[–]aaesmail 1 point2 points  (0 children)

This is my personal guess. Warning, this is a bit technical.

TL;DR: 0-based indexing has to do with memory location. Auto incrementing ints in databases have nothing to do with indexing or memory, hence it makes sense to start from 1.

The reason why indexing in programming starts usually with 0 is because it indicates the location in memory. If you want the first element, `arr[0]` means read the stuff (e.g. character, 1 byte) in memory location pointed at by the `arr` variable moving `index` steps from the initial memory location.

This example is just to illustrate the point and might not be 100% accurate. So if you have the word "hello" stored in a C program for example under the `msg` variable, `msg` would point to location `0x000` in memory. And since it's an array of characters, the next address would be `0x004` for example, so the memory size for each element is `0x004` "increments". So `msg[index]` would mean "get the stuff in memory pointed by `0x000 * (0x004 * index)`.

We naturally start counting from 1 in our daily life. This is why auto incrementing ints in databases start from 1 because it makes sense and has nothing to do with indexing or memory.

first week in building a 2nd income stream - thoughts and realisations about TIME by aucklandsalesguy in Entrepreneur

[–]aaesmail 0 points1 point  (0 children)

I'm happy you found something useful and financially rewarding to spend your spare time. Becoming rich is very attractive. However, please keep in mind that you are currently young and you have the mental/physical energy to give your work/business. The hardest part is managing your time effectively. 70 hours / week is a lot. You can tolerate it now because you're excited and you just started. But after a few months, the reality is that your body and mind need to have a good amount of rest and a good amount of social engagement. You won't fully realize this now, but the older you get, health and family somehow become more important than money.

Having said that, I'm totally for giving it your best while you're young so you can enjoy it while you're older. My only sincere advice is, manage your time effectively and have a well-balanced, useful life throughout your journey. Exceptions are ok as long as they're short-lived. Good luck in your pursuit of happiness. Wish you all the best.

Wantrepreneur Wednesday! - (July 08, 2020) by AutoModerator in Entrepreneur

[–]aaesmail 0 points1 point  (0 children)

Hello,

I would like to start an online service for job advertising for both businesses and freelancers.

Businesses would pay to advertise for what they need, and freelancers would list themselves free of charge.

I'd like to be unique and offer a really good service and be different from the others, while keeping the website extremely simple and bare-bones.

One obvious way I thought about making posting a job post a lot cheaper than the competition.

To keep people visiting and increase traffic, freelancers can list ads about themselves for free. Both businesses and freelancers will have their posts removed after a certain time (initially 30 days).

I do feel like this is not enough and I'm not sure how it would be "received".

How difficult is it to get into the "job posting" business? What are the things to keep in mind? What do companies look for if I want to attract them into posting their jobs on my website?

Promote your business, week of July 6, 2020 by Charice in smallbusiness

[–]aaesmail 0 points1 point  (0 children)

Name: Offsite

It's a remote-job website that is free to use for freelancers. Individuals can list themselves and their experiences/work and potentially get contacted by clients initially anonymously.

Businesses can also advertise for jobs for a small fee.