10,000 Matching Annotations
- Sep 2023
-
stackoverflow.com stackoverflow.com
-
I want the fact that my collection is lazy to be an implementation detail.
-
-
stackoverflow.com stackoverflow.com
-
You just blew my mind Marc-André. My code just went from idiotic to idiomatic.
-
-
sendgrid.com sendgrid.com
-
In order to enable MPP, users must have Apple devices, configure their email account to use Apple Mail applications, update their operating system to the latest version, and opt into MPP.
-
-
docs.sendgrid.com docs.sendgrid.com
-
In other words, when a recipient clicks the “unsubscribe” link in your email, the recipient’s mail client will send an email to this address. It is your responsibility to receive and process these generated emails.
-
You must include at least the mailto portion of the List-Unsubscribe header, since some services only support this portion (iOS, for example). However, many inbox providers and mail clients honor both methods. To ensure that the greatest number of your recipients have the ability to unsubscribe from your emails, thus protecting your reputation as a sender, we recommend including both mailto and http.
-
You must include at least the mailto portion of the List-Unsubscribe header, since some services only support this portion (iOS, for example). However, many inbox providers and mail clients honor both methods. To ensure that the greatest number of your recipients have the ability to unsubscribe from your emails, thus protecting your reputation as a sender, we recommend including both mailto and http.
-
It is possible to use the List-Unsubscribe header even if you do not want to use subscription tracking. This is useful for users who want to provide their recipients an easy way to unsubscribe from their emails without relying on SendGrid’s tracking features. Continue reading below for an explanation of the List-Unsubscribe header, and how you can use it when sending email via SendGrid.
-
List-Unsubscribe is a small piece of text that can be inserted in the header section of your email. The List-Unsubscribe header will insert an “unsubscribe” button, or link, next to the From address at the top of your email. A recipient can click this link to notify you that they would like to unsubscribe from your emails.
-
-
-
List-unsubscribe can help reduce spam complaints.If subscribers can’t find the unsubscribe link, they may click the spam reporting button instead. This could hurt your email deliverability and sender reputation. To mailbox providers, a spam complaint is a spam complaint, regardless of whether the recipient actually perceived the message as malicious.
-
Support for list-unsubscribe varies across email clients.
-
-
www.dnswl.org www.dnswl.org
-
If anything in this policy does not fit with your own local policy, you should not use dnswl.org for whitelisting or similar purposes.
Tags
Annotators
URL
-
-
answers.microsoft.com answers.microsoft.com
-
It looks like this is a newsletter, but we aren't sure if it is safe to unsubscribe from it using the information provided by the sender
-
-
stackoverflow.com stackoverflow.com
-
Apparently, Google uses some additional heuristics to decide whether the link should be displayed or not. The List-Unsubscribe header could be abused by spammers to validate that their target got the message, and thus, GMail only shows the unsubscribe link if the source of the message has accumulated sufficient trust.
Shouldn't it be controllable by the end user, in the same way that they can press a button to show all images if images are blocked by default for security/privacy reasons??
-
-
datawookie.dev datawookie.dev
-
dmarcly.com dmarcly.com
-
DKIM has proven to be a highly effective means by which a receiver can verify that the signed fields of an email have not been modified in transit. DKIM is as secure as the weakest link - the private key, though. The private key of a DKIM keypair is vulnerable to being stolen if an attacker is able to compromise the system in which it is stored. Therefore, to minimize the risk of active DKIM keys being compromised, they should be changed frequently. This is a practice known as DKIM key rotation. Each time a key is rotated, a new {selector, private key, public key} tuple is created. Then the public key will need to be published in the DNS, and you need to re-configure the outgoing email server to use the new private key. After this is done, the outgoing email server will use the new private key to sign all outgoing email messages.
-
Multiple private/public key pairs are required due to the following reasons: DKIM key rotation which we will explain in the next section; setting up DKIM with multiple email delivery services on a single domain; each service can have their own separate selectors so that signing/verifying with one service doesn't interfere with that with another.
-
a tuple { selector, private key, public key } is created
-
-
en.wikipedia.org en.wikipedia.org
-
en.wikipedia.org en.wikipedia.org
-
A record can be viewed as the computer analog of a mathematical tuple, although a tuple may or may not be considered a record, and vice versa, depending on conventions and the specific programming language.
-
An object in object-oriented language is essentially a record that contains procedures specialized to handle that record; and object types are an elaboration of record types. Indeed, in most object-oriented languages, records are just special cases of objects, and are known as plain old data structures (PODSs), to contrast with objects that use OO features.
-
A record type is a data type that describes such values and variables.
-
In type theory, product types (with no field names) are generally preferred due to their simplicity
-
-
en.wikipedia.org en.wikipedia.org
Tags
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
Most typed functional programming languages implement tuples directly as product types
Tags
Annotators
URL
-
-
www.hmailserver.com www.hmailserver.com
-
Did you really need to bump/hijack a 8 year old post?
-
And... next time create your own topic, this only illustrates your laziness!
-
Have you tried asking gmail why THEY fail your DKIM signature?
-
-
advocatetanmoy.com advocatetanmoy.com
-
A distinction exists between a burden of proof and onus of proof.
-
-
github.com github.com
-
-
Dnsruby presents an enhanced API for DNS. It is based on Ruby's core resolv.rb Resolv API, but has been much extended to provide a complete DNS implementation.
Tags
Annotators
URL
-
-
-
Start with the default gemfile: gem "rails", "~>x.x.x" Replace the xes with the actual version of rails that you need. It'll be in config/environment.rb, unless it's a Rails 3 app, in which case you can just put 3.0.0. Start your app, and watch for errors. When there's an error about not being able to load something, add that gem to the gemfile. Eventually, you'll have the whole list. :)
-
-
documentation.mailgun.com documentation.mailgun.com
-
Each message you send out has both the sender and from address. Simply put, the sender domain is what the receiving email server sees when initiating the session, and the from address is what your recipients will see.
-
For better deliverability it is recommended to use the same from domain as the sender,
-
Domain names do not matter as much if you’re only sending. You can send messages from sales@mycompany.com even if your domain name is called anothercompany.org. Although, it is best for deliverability if you are using the same domain in the From field that the actual sender is using.
-
-
help.mailgun.com help.mailgun.com
-
Each message you send out has both the sender and from address. The sender domain is what the receiving email server sees when initiating the session. The from address is what your recipients will see. For better deliverability it is recommended to use the same from domain as the sender.
-
-
help.mailgun.com help.mailgun.com
-
However, if the previous user was also the Account Owner, the previous user will need to promote a different user to the Account Owner role. After that, the previous user can finally be deleted.
-
-
help.mailgun.com help.mailgun.com
-
Ultimately, the "On Behalf Of" notation highlights the mismatch between the domain used in the Sender field (mail.example.com) and the domain used in the From field (example.com). In the above example, the envelope is sent through the domain mail.example.com, but the message is listed as being sent from the domain example.com.
-
This nuance is important as the Sender field is an envelope field and the From is an email header field - each representing different aspects of the message.
-
there is no way for Mailgun to prevent an email client from displaying the "On Behalf Of" notation as long as the domains contained in the Sender and From fields don't match. However, ensuring the exact same domain is used in both fields will eliminate the "On Behalf Of" notation.
-
-
github.com github.com
-
Migration from pre-exisiting non-flatpak installations In order to migrate from pre-exisiting non-flatpak installation and preserve all settings please copy or move entire ~/.thunderbird folder into ~/.var/app/org.mozilla.Thunderbird/.thunderbird In case Thunderbird opens a new profile instead of the existing one, run: flatpak run org.mozilla.Thunderbird -P then select the right profile and tick "Use the selected profile without asking on startup" box.
-
-
askubuntu.com askubuntu.com
-
I'm using Kubuntu 23.04, do not use Snaps, and wish to update to Thunderbird 115 from the installed version 102. Is this possible? It appears as if Ubuntu have stopped providing non-Snap packages for mainstream apps and Thunderbird themselves offer me a tar.bz2 whilst I'd rather use packaged apps. Will Thunderbird 115 be available as an official .deb file at all; will it be in the repos? What's the best non-Snap way to install it and keep it updated?
-
-
support.google.com support.google.com
-
Send on behalf of another user or account Uncheck Treat as an alias. Example: You manage 2 email addresses in separate accounts or mail systems. You sign in to each account separately to read messages. But you want the convenience of sending mail as either address from your Gmail account.
Tags
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
legitimate form of privilege escalation
-
-
en.wikipedia.org en.wikipedia.org
-
Users with unprivileged credentials who properly execute "sudo" (for example) to perform authorised administrative activities are also "escalating privilege". It is not only an exploit or a bug.
-
There are many examples of a user's or process's privileges being elevated/escalated by design. - sudo in general - GitHub's "sudo mode" - https://en.wikipedia.org/wiki/Setuid:
-
I dispute that there's a such thing as "horizontal privilege escalation", and not just because the term is a bit of an oxymoron.
-
-
en.wikipedia.org en.wikipedia.org
-
They are often used to allow users on a computer system to run programs with temporarily elevated privileges to perform a specific task. While the assumed user id or group id privileges provided are not always elevated, at a minimum they are specific.
-
This allows the system designer to permit trusted programs to be run which a user would otherwise not be allowed to execute.
-
-
en.wikipedia.org en.wikipedia.org
-
-
To take advantage of this wonderful opportunity, put #! /bin/sh at the left margin of the first line of your shell scripts.
-
-
support.google.com support.google.com
-
Don’t send test phishing messages or test campaigns from your domain. Your domain’s reputation might be negatively affected, and your domain could be added to internet blocklists.
What does a test compaign mean exactly? Can't I send test messages without fear? Isn't sending tests essential prior to sending a live message to all recipients?
-
-
sendersupport.olc.protection.outlook.com sendersupport.olc.protection.outlook.com
-
-
Microsoft strongly recommends that you conduct email testing prior to sending live communications to your users/customers
-
-
-
DATA Replaces Siri with ChatGPT. Or any other language model of your choice.
-
-
www.indiewire.com www.indiewire.com
-
“If somebody sends me something like that I’ll immediately erase it and say, ‘Please, sorry, do not send me things of people doing me,’” Anderson said in an interview with The Times. “Because I do not want to look at it, thinking, ‘Is that what I do? Is that what I mean?’ I don’t want to see too much of someone else thinking about what I try to be because, God knows, I could then start doing it.”
-
“What it does is it sucks something from you,” he said of A.I. “It takes something from your soul or psyche; that is very disturbing, especially if it has to do with you. It’s like a robot taking your humanity, your soul.”
-
-
-
During the discussion, Musk latched on to a key fact the team had discovered: The neural network did not work well until it had been trained on at least a million video clips.
-
By early 2023, the neural network planner project had analyzed 10 million clips of video collected from the cars of Tesla customers. Did that mean it would merely be as good as the average of human drivers? “No, because we only use data from humans when they handled a situation well,” Shroff explained. Human labelers, many of them based in Buffalo, New York, assessed the videos and gave them grades. Musk told them to look for things “a five-star Uber driver would do,” and those were the videos used to train the computer.
-
The “neural network planner” that Shroff and others were working on took a different approach. “Instead of determining the proper path of the car based on rules,” Shroff says, “we determine the car’s proper path by relying on a neural network that learns from millions of examples of what humans have done.” In other words, it’s human imitation. Faced with a situation, the neural network chooses a path based on what humans have done in thousands of similar situations. It’s like the way humans learn to speak and drive and play chess and eat spaghetti and do almost everything else; we might be given a set of rules to follow, but mainly we pick up the skills by observing how other people do them.
-
Instead of being based on hundreds of thousands of lines of code, like all previous versions of self-driving software, this new system had taught itself how to drive by processing billions of frames of video of how humans do it, just like the new large language model chatbots train themselves to generate answers by processing billions of words of human text.
-
-
rubyreferences.github.io rubyreferences.github.io
-
A new class for containing value objects: it is somewhat similar to Struct (and reuses some of the implementation internally), but is intended to be immutable, and have more modern and cleaner API.
-
# Note that it could be in `args.first`, or in `kwargs[:id]` now, so it is either this: def initialize(*args, **kwargs) if !args.empty? args[0] = args[0].to_i elsif kwargs.key?(:id) kwargs[:id] = kwargs[:id].to_i end super(*args, **kwargs) end
-
Time.new('2023-01-29 00:29:30') # => 2023-01-29 00:29:30 +0200
-
Before Ruby 3.2, there core class Time provided no way to to get back a Time value from any serialization, including even simple Time#inspect or #to_s. The Time.parse provided by standard library time (not core functionality, doesn’t work with explicit require 'time'), and tries to parse every imaginable format, while Time.new with string is stricter.
-
string ones are those most of the Rubyists remember.
-
Low-level processing of strings (like networks middleware, or efficient search algorithms, or packing/unpacking) might need an ability to operate on a level of single bytes, regardless of original string’s encoding. It is especially important while handling variable-length encodings like UTF-8. Before methods introduction, the only way to perform byte-level processing was to forcing string encoding into ASCII-8BIT, process, and then force encoding back.
-
There are many simple use cases like pagination (when “21 items / 10 per page” should yield “3 pages”).
-
It seems that the method is a direct equivalent of a.fdiv(b).ceil, and as such, annoyingly unnecessary, but fdiv, due to floating point imprecision, might produce surprising results in edge cases
-
Note that used_refinements is a class method of a Module, and put there just for organizational purposes, while returning refinements list of the current context. There is no way to ask arbitrary module which refinements it uses (e.g., there is no Calculator.used_refiments).
-
make_a_class::CONST = 42.tap { puts "Calculating the value" } # Prints: # In Ruby 3.1: # Calculating the value # Making a class # In Ruby 3.2: # Making a class # Calculating the value # Even simpler: NonExistentModule::CONST = 42.tap { puts "Calculating the value" } # Ruby 3.1: # Prints "Calculating the value" # raises "uninitialized constant NonExistentModule" (NameError) # Ruby 3.2: # just raises "uninitialized constant NonExistentModule" (NameError)
-
Tags
- immutable data
- comfortable because familiar
- unnecessary
- good reason
- surprising behavior
- Ruby: Data
- excellent technical writing
- readability: depends on familiarity
- distinction
- new feature
- immutable-equivalent data
- changelog
- principle of least surprise
- unfortunate
- verbose
- Ruby
- runnable example
- good example
- changes (software)
- modern techniques
Annotators
URL
-
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
I do not disagree, but I would also like to point out that it can confuse newbies, e. g. when they wonder whether they should use class_eval or instance_eval. Some concepts are not trivial to remember offhand.
-
For me, I don't have an issue, but there was one syntax situation I found awkward: I need to sometimes know whether it is a class or a module that I am modifying. So I may have code: module Foo module Bar class Baz versus: class Foo::Bar::Baz It's not a huge issue, but ruby would yield an error if I specify a class or module incorrectly (which can happen if you spread code out into different .rb files, so I understand why there is an error message shown, to avoid accidents). But I then also wondered why I have to care whether it is a module or class, if my primary goal is to modify something, such as by adding a method. If I want to add a method: def foobar; end then I really should never be required to have to know whether I am modifying a class or a module.
-
As "module" is more generic concept than "class", the name misleadingly implies that either this method doesn't returns refined modules, or modules can't be refined. This is obviously not true and trivially disproved: module Refs refine Enumerable do def foo = puts 'foo' end end Refs.refinements[0].refined_class #=> Enumerable. Which is, well, not a class. # The refinement is usable, so it is not a mute concept: using Refs [1, 2, 3].foo # prints "foo" successfully I believe we refer to "modules" when some feature applies to modules and classes. Unless there is some deeper consideration for the current naming (I don't see justification in #12737, but I might miss something), the method should be renamed or aliased.
-
-
store.entrust.com store.entrust.com
-
Customer service 24/5 follow the sun
first sighting: 24/5 and follow the sun
Tags
Annotators
URL
-
-
-
Leaky Bucket is implemented similarly to Token Bucket where OVER_LIMIT is returned when the bucket is full. However tokens leak from the bucket at a consistent rate which is calculated as duration / limit. This algorithm is useful for metering, as the bucket leaks allowing traffic to continue without the need to wait for the configured rate limit duration to reset the bucket to zero.
Tags
Annotators
URL
-
-
documentation.mailgun.com documentation.mailgun.com
-
A good analogy for your email reputation is your personal credit score. Obviously, a bad reputation will hurt you. However, not having a reputation will also hurt you. If ESPs don’t know you (or more specifically your IP and domain) they will assume the worst and filter you, at least initially. It’s tough to blame them given all the spam out there. Due to the importance of reputation, a significant portion of our discussion on best practices revolves around building and maintaining your email reputation.
-
We dream of a day when IP reputation does not matter and we can rely on domain reputation, but unfortunately we are not there yet.
-
-
www.mailgun.com www.mailgun.com
-
These protocols work for both transactional (one to one) and marketing email (one to many or “bulk”).
-
-
stackoverflow.com stackoverflow.com
-
split_part(email, '@', 2) AS domain
-
-
discussions.apple.com discussions.apple.com
-
Essentially, @mac.com is legacy users and was in place from the debut of osX to late 2000s. It required a annual paid subscription to have an email address, lol. Then the short-lived mobileMe era happened, which lasted only a couple years before Apple retracted and replaced it with iCloud, a much more sweeping service. MobileMe was also a paid subscription and included primordial versions of photo sharing and web hosting, etc. The iCloud era starting in 2012 finally ushered in free email addresses and free operating system updates. That's when the business model of large tech companies turned more into user accumulation wars to see who can attract the most subscribers and retain them in their ecosystem of products.
-
The iCloud era starting in 2012 finally ushered in free email addresses and free operating system updates. That's when the business model of large tech companies turned more into user accumulation wars to see who can attract the most subscribers and retain them in their ecosystem of products.
-
-
www.reddit.com www.reddit.com
-
I am glad you wrote that
-
-
www.reddit.com www.reddit.com
-
You can no longer create accounts with Yahoo domains other than "@yahoo.com",
-
I'm curious: what is the reason for Yahoo discontinuing the "@ymail.com" domain?I'm aware that there's now a 2nd domain option available, "@myyahoo.com", and I recently took advantage of that to create a new address. But "@ymail.com" honestly looks more appealing to me than either of the "yahoo" iterations.
-
-
gitlab.com gitlab.com
-
# This helper allows you to reliably highlight text within a given Element by # simulating mouse actions. # module Features module HighlightContentHelper def highlight_content(node) height = node.native.rect.height width = node.native.rect.width page.driver.browser.action .move_to(node.native, -(width / 2), -(height / 2)) .click_and_hold .move_by(width, height) .release .perform end
-
-
-
But you can't configure Standard Ruby. You can take it or leave it. If this seems presumptive, constraining, and brusque: you're right, it usually does feel that way at first.
-
Tags
Annotators
URL
-
-
github.com github.com
-
I'd suggest that you play around a little bit with a vanilla app. Create a brand new app without any additional files, just what rails new generates. See how bin/rails runner Models raises an error because there is no models directory in autoload_paths. Now, put config.autoload_paths += %W(#{config.root}/app) in config/application.rb and observe how bin/rails runner Models just returns a prompt. With the confidence of having that running, then transalate to your app.
-
-
-
Root directories are recommended not to be nested; however, Zeitwerk provides support for nested root directories since in frameworks like Rails, both app/models and app/models/concerns belong to the autoload paths. Zeitwerk identifies nested root directories and treats them as independent roots. In the given example, concerns is not considered a namespace within app/models. For instance, consider the following file: app/models/concerns/geolocatable.rb should define Geolocatable, not Concerns::Geolocatable.
-
-
github.com github.com
-
Should any one stumble upon this issue @tenderlove reverted commit a8bf129 in a71350c which is in v5.0.0.beta1 and later.
-
I agree with this statement so much. We should absolutely be failing hard rather than forcing people to debug thread safety issues at runtime. I can't think of anything more infuriating than debugging an issue that happens "sometimes".
-
The problem is that in the case where an app is multi-threaded, and we don't switch off autoload, the case would be that it probably won't blow up, but random stuff will mysteriously sometimes fail in weird ways. So ask yourself this, what would you rather want, option 1) where you can get an exception at runtime, or option 2) where you get random, unpredictable, weird, hard to explain, difficult to debug bugs at runtime. Personally, I'm going to choose option 1. The downside of thread-safety issues is so much worse than the downside of the possibility of an exception. The way you're handling it makes it sound as though thread-safety is not important, as though Rails is still optimizing for the single-threaded case. That seems like a huge step back.
-
-
-
What can we do to undo this commit?
-
However one of these paths is quite often lib which could lead to unintended consequences due to the 'junk drawer' nature of this directory.
-
- Aug 2023
-
stackoverflow.com stackoverflow.com
-
async is a concurrency technique. If you need concurrency, async is required for node to work properly (not "better"). If you don't have concurrency, you don't need async. The point is you need to actually understand what async does for you and why. It's not inherently "better" for no reason and you don't need to memorize it as a "best practice". If the OP is writing a command line utility to alter a JSON file then exit, async complicates the code for no reason as the concurrency is not required.
-
The question is also not about error handling and if the file write fails, exiting with a stack trace is reasonable default behavior because there's not much you can do to recover from that.
-
async vs. sync depends exactly on what you are doing in what context. If this is in a network service, you need async. For a command line utility, sync is the appropriate paradigm in most simple cases, but just knee-jerk saying "async is better" is not correct. My snippet is based on the OP snippet for context.
-
-
github.com github.com
-
Speed is great but if it doesn't conform to the specification, that's not a great case for using it for future development
-
-
stackoverflow.com stackoverflow.com
-
If you want to mimic a more production like situation you might use this workflow: Create a package of your submodule locally: cd /path/to/your/module npm pack This will create a .tgz file of your package in /path/to/your/module Install the local package of the submodule in your application: cd /path/to/your/application npm install /path/to/your/module/<YourModule>-<YourModulesVersion>.tgz
-
-
ajv.js.org ajv.js.org
-
Ajv generates code to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization.
-
-
www.npmjs.com www.npmjs.comajv1
-
We value conscious curation of our library size, and balancing performance and functionality. To that end, we cannot accept every suggestion. When evaluating pull requests we consider:
-
-
hirok.io hirok.io
-
While this works, it’s not a great developer experience. In development, we don’t always know ahead of time all the packages that need to be linked. Or keep track of the previously linked packages.This confusing behavior compounds to the poor usability and predictability of npm link.
-
footguns
-
npx link is a tool I developed as a safer and more predictable alternative to npm link.
-
-
ajv.js.org ajv.js.org
-
Serializing the data with a function specialized to your data shape can be more than 10x compared with JSON.stringify.
-
-
-
@exodus/schemasafe can also function in a linter mode, collecting all schema errors instead of throwing on the first one.
-
-
stackoverflow.com stackoverflow.com
-
Active job instances include ActiveSupport::Rescuable which means you can use rescue_from in a job in the same way you can in a controller.
-
-
github.com github.com
-
The point of acts_as_paranoid is keeping old versions around, not really destroying them, so you can look at past state, or roll back to past version. Do you consider the attached file part of the state you should be able to look at? If you roll back to past version, should it have it's attachment there too, in the restored version?
-
I think the problem with after_destroy is that it is triggered before the database commits. This means the change may not yet be seen by other processes querying the database; it also means the change could be rolled back, and never actually commited. Since shrine deletes the attachment in this hook, that would mean it might delete the attachment prematurely, or even delete the attachment when the record never ends up destroyed in the database at all (in case of rollback), which would be bad. For shrine's logic to work as expected here, it really does need to be triggered only after the DB commit in which the model destroy is committed.
-
-
-
extensible plugin system.
-
Modular design – the plugin system allows you to load only the functionality you need
-
-
Shrine was heavily inspired by Refile and Roda. From Refile it borrows the idea of "backends" (here named "storages"), attachment interface, and direct uploads. From Roda it borrows the implementation of an extensible plugin system.
-
-
-
4. Too much couplingAnother issue I had with this is the coupling that it might introduce in your code. I do understand that our community in general is not very much interested in dealing with coupling and I am not an expert at this either, but I do get a feeling that this suppress method would lead to some very bad usages.For instance, why does the Copyable module needs to know about a class named Notification?
-
-
www.red-gate.com www.red-gate.com
-
In these other tests we do not care what was passed to the Load method so specify a “don’t care” with It.IsAny.
-
Michael Sorens is passionate about productivity, process, and quality. Besides working at a variety of companies from Fortune 500 firms to Silicon Valley startups, he enjoys spreading the seeds of good design wherever possible, having written over 100 articles, more than a dozen wallcharts, and posted in excess of 200 answers on StackOverflow.
-
-
en.wikipedia.org en.wikipedia.org
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
As you say, you can use after_add and after_remove callbacks. Additionally set after_commit filter for association models and notify "parent" about change. class User < ActiveRecord::Base has_many :articles, :after_add => :read, :after_remove => :read def read(article) # ;-) end end class Article < ActiveRecord::Base belongs_to :user after_commit { user.read(self) } end
-
As you say, you can use after_add and after_remove callbacks. Additionally set after_commit filter for association models and notify "parent" about change. class User < ActiveRecord::Base has_many :articles, :after_add => :read, :after_remove => :read def read(article) # ;-) end end class Article < ActiveRecord::Base belongs_to :user after_commit { user.read(self) } end
-
-
itsfoss.com itsfoss.com
-
-
It may seem like Testing is some sort of beta, unstable version but that’s not entirely true. Debian Testing is the next Debian stable version. The actual development branch is the Debian Unstable (also known as Sid). Debian Testing lies somewhere in between the unstable and stable branch where it gets the new features before the stable release.
-
-
github.com github.com
-
ActiveStorage has a different approach than what is suggested by @dhh here. The idea there seems to be to rule out a default and to explicitly set ActiveStorage::Current.url_options or by include ActiveStorage::SetCurrent. I don't understand why and asked about it in the Rails Forum. Maybe someone here can point out why we don't use a sensible default in ActiveStorage?
-
-
stackoverflow.com stackoverflow.com
-
Because Active Storage gem does not specify AWS SDK as its dependency, it’s quite possible you updated Active Storage while leaving AWS SDK behind (happened to me).
-
You probably solved not because of using aws-sdk gem instead of aws-sdk-s3 but simply because you updated the SDK. I’m sure just updating the aws-sdk-s3 would solved too.
-
-
stackoverflow.com stackoverflow.com
-
Since this is the first search result of 'rails gcs cors' issue, I want to say that the sample file in guide guides.rubyonrails.org/… is different from OP's.
-
-
www.npmjs.com www.npmjs.com
-
well-written
-
-
pragmaticstudio.com pragmaticstudio.com
-
blog.commutatus.com blog.commutatus.com
-
Although it is possible to manually craft all the necessary HTTP requests to get the signed keys and manually upload the file to the storage backend, thankfully we don’t have to. Rails already provides us with the @rails/active_storage package, which greatly simplifies the process.
-
-
-
-
Now this is where the magic of our activestorage library from node package manager comes in. At the top of our CreateAccount.js file we need to import a Component, DirectUpload, from this library…
-
Before we move on to uploading an image, let’s give our users the ability to logout
-
Letting the User Logout
log out
-
-
www.ruby-forum.com www.ruby-forum.com
-
I ran into the same problem and never really found a good answer via the test objects. The only solution I saw was to actually update the session via a controller. I defined a new action in one of my controllers from within test_helper (so the action does not exist when actually runnning the application). I also had to create an entry in routes. Maybe there’s a better way to update routes while testing. So from my integration test I can do the following and verfiy: assert(session[:fake].nil?, “starts empty”) v = ‘Yuck’ get ‘/user_session’, :fake => v assert_equal(v, session[:fake], “value was set”)
-
I find the use of the term “session” within integration tests a bit unfortunate (open_session, etc), since there are also these session objects, which are however different. Maybe replace by “user_session” ?
-
-
stackoverflow.com stackoverflow.com
-
It does, however, lack certain features (such as progress monitoring) that XMLHttpRequest provides.
-
-
evilmartians.com evilmartians.com
-
TL;DR For classic Rails apps we have a built-in scope for preloading attachments (e.g. User.with_attached_avatar) or can generate the scope ourselves knowing the way Active Storage names internal associations.GraphQL makes preloading data a little bit trickier—we don’t know beforehand which data is needed by the client and cannot just add with_attached_<smth> to every Active Record collection (‘cause that would add an additional overhead when we don’t need this data).That’s why classic preloading approaches (includes, eager_load, etc.) are not very helpful for building GraphQL APIs. Instead, most of the applications use the batch loading technique.
-
-
engineering.universe.com engineering.universe.com
-
def rating(like_count, angry_count) like_count * 2 - angry_count end
-
-
-
math.stackexchange.com math.stackexchange.com
-
so a formula is like a dead equation?
-
-
evilmartians.com evilmartians.com
-
-
To upload a file, a client must perform the following steps:Obtain the file metadata (filename, size, content type and checksum)Request direct upload credentials and a blob ID via API—createDirectUpload mutationUpload the file using the credentials (no GraphQL involved, HTTP PUT request).
-
-
www.countable.com www.countable.com
-
-
github.com github.com
-
If I find time between work and personal life I'll try to weigh in here, but those two things are keeping me pretty busy at the moment :)
-
just stopping by to say thanks for including me as an author on the commit. That's nice of you!
Tags
Annotators
URL
-
-
-
let’s setup
let's set up
-
all setup
"all set up"
-
user’s will be able to
"users will"
-
-
www.flaticon.com www.flaticon.com
-
-
www.flaticon.com www.flaticon.com
Tags
Annotators
URL
-
-
edgeguides.rubyonrails.org edgeguides.rubyonrails.org
-
If you are using UUIDs instead of integers as the primary key on your models, you should set Rails.application.config.generators { |g| g.orm :active_record, primary_key_type: :uuid } in a config file.
-
-
stackoverflow.com stackoverflow.com
-
– Tyler Rick
-
I make a file named: app/models/active_storage/attachment.rb. Because it's in your project it takes loading precedence over the Gem version. Then inside we load the Gem version, and then monkeypatch it using class_eval: active_storage_gem_path = Gem::Specification.find_by_name('activestorage').gem_dir require "#{active_storage_gem_path}/app/models/active_storage/attachment" ActiveStorage::Attachment.class_eval do acts_as_taggable on: :tags end The slightly nasty part is locating the original file, since we can't find it normally because our new file takes precedence. This is not necessary in production, so you could put a if Rails.env.production? around it if you like I think.
-
I assume that the ActiveStorage::Attachment class gets reloaded dynamically and that the extensions are lost as they are only added during initialization. You’re correct. Use Rails.configuration.to_prepare to mix your module in after application boot and every time code is reloaded: Rails.configuration.to_prepare do ActiveStorage::Attachment.send :include, ::ActiveStorageAttachmentExtension end
-
-
www.digitalocean.com www.digitalocean.com
-
Since DigitalOcean will ignore it, you can set it to whatever value you’d like. The value unused in the example code makes it clear that you’re not using it.
-
-
github.com github.com
-
For lost googlers:
-
-
stackoverflow.com stackoverflow.com
-
application/xml: data-size: XML very verbose, but usually not an issue when using compression and thinking that the write access case (e.g. through POST or PUT) is much more rare as read-access (in many cases it is <3% of all traffic). Rarely there where cases where I had to optimize the write performance existence of non-ascii chars: you can use utf-8 as encoding in XML existence of binary data: would need to use base64 encoding filename data: you can encapsulate this inside field in XML application/json data-size: more compact less that XML, still text, but you can compress non-ascii chars: json is utf-8 binary data: base64 (also see json-binary-question) filename data: encapsulate as own field-section inside json
-
-
meta.stackoverflow.com meta.stackoverflow.com
-
I believe the final policy shall contain robust rationale and, in the best way possible, avoids the perception of rAIcial discrimination
-
Overall, because the average rate of getting correct answers from ChatGPT and other generative AI technologies is too low, the posting of answers created by ChatGPT and other generative AI technologies is substantially harmful to the site and to users who are asking questions and looking for correct answers.
-
The primary problem is that while the answers which ChatGPT and other generative AI technologies produce have a high rate of being incorrect, they typically look like the answers might be good and the answers are very easy to produce.
-
-
www.public.law www.public.law
-
Law is code that belongs to all of us
-
-
edgeguides.rubyonrails.org edgeguides.rubyonrails.org
-
The method name is generated by replacing spaces with underscores. The result does not need to be a valid Ruby identifier though — the name may contain punctuation characters, etc. That's because in Ruby technically any string may be a method name. This may require use of define_method and send calls to function properly, but formally there's little restriction on the name.
-
-
www.rootstrap.com www.rootstrap.com
Tags
Annotators
URL
-
-
-
Factory :video_file do file { fixture_file_upload 'test.png', 'image/png' } end
-
-
developer.chrome.com developer.chrome.com
-
Auto-update aside, you might also have found it hard to find a Chrome binary with a specific version. Google intentionally doesn’t make versioned Chrome downloads available, since users shouldn’t have to care about version numbers—they should always get updated to the latest version as soon as possible. This is great for users, but painful for developers needing to reproduce a bug report in an older Chrome version.
-
Due to there being no good way to solve these issues, we know that many developers download Chromium (not Chrome) binaries instead, although this approach has some flaws. First, these Chromium binaries are not reliably available across all platforms. Second, they are built and published separately from the Chrome release process, making it impossible to map their versions back to real user-facing Chrome releases. Third, Chromium is different from Chrome.
-
Auto-update: great for users, painful for developersOne of Chrome’s most notable features is its ability to auto-update. Users are happy to know they’re running an up-to-date and secure browser version including modern Web Platform features, browser features, and bug fixes at all times.However, as a developer running a suite of end-to-end tests you might have an entirely different perspective:You want consistent, reproducible results across repeated test runs—but this may not happen if the browser executable or binary decides to update itself in between two runs.You want to pin a specific browser version and check that version number into your source code repository, so that you can check out old commits and branches and re-run the tests against the browser binary from that point in time.None of this is possible with an auto-updating browser binary. As a result, you may not want to use your regular Chrome installation for automated testing. This is the fundamental mismatch between what’s good for regular browser users versus what’s good for developers doing automated testing.
-
-
github.com github.com
-
It is not intended to piecewise load rspec-rails.
.
-
-
guides.rubyonrails.org guides.rubyonrails.org
-
def prevent_delivery_to_guests if @user && @user.guest? mail.perform_deliveries = false end end
-
-
stackoverflow.com stackoverflow.com
-
The Mailer is not the right place for business logic. When you use Sidekiq than your Job object should do the check before actually calling the Mailer.
-
-
stackoverflow.com stackoverflow.com
-
The Mailer, IMHO, is the wrong place for this logic. The mailer should do nothing but format and send messages. The logic to decide whether or not to send should be within the calling block of code.
-
-
github.com github.com
-
rendered.should have_selector("#header") do |header| header.should have_selector("ul.navlinks") end Both of which silently pass - however, capybara doesn't support a :content option (it should be :text), and it doesn't support passing blocks to have_selector (a common mistake from Webrat switchers).
-
- Jul 2023
-
stackoverflow.com stackoverflow.com
-
expect(described_class.active).not_to include_any_of [records_not_to_be_included]
-
-
www.imdb.com www.imdb.com
-
Unlike Turkophobic reviews I know real history behind WW1, Armenian gangs (most famous ones Henchak and Dashnak) killed lots of people and rob their neighbors. My mom side ancestors came from Van and I heard stories about Armenian neighbors came to rob them when their husbands went to war.Turkey suggested Armenia for a joint historians board for so-called Armenian Genocide research and opening state archives. Armenia denied their proposition.Let me explain this to you: you don't accept historians to decide, you praise (millions of) so-called Armenian Genocide supporter films without historical proof and if you see one film which just picture real situation it is propaganda. You say it is a propaganda because it conflicts with your propaganda.
-
You say it is a propaganda because it conflicts with your propaganda.
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
# if contract is passed use contract.start_date as date # Date.current otherwise # if date is given, the block is ignored. date { @overrides[:contract]&.start_date || Date.current }
-
-
stackoverflow.com stackoverflow.com
-
I know it might suck a little, but it sounds like the way to do it. As a thought though, if you're struggling with your tests it is usually a sign you'll struggle with it down the track and you should be redesigning the APIs. I can't see an alternative way of doing it, but you might be able to with the knowledge of the domain.
ugly/messy/less-than-ideal
-
-
-
I would say it's text when interpreted as text/plain it's human readable. Otherwise it's binary. That is, binary = for machines only.
-
Of course there are perversions like XMI and Microsoft's new formats.
-
-
euclideanspace.com euclideanspace.com
-
The XMI schema also extends the XML schema so that definitions of objects can be stored. This provives a way to hold a UML model.
-
XMI is a standard which defines how to serialise object instances. Although XML is a very good way to store information in a tree structured way, it is not object oriented. XMI extends XML to make it object oriented.
-
-
-
The representation of objects in terms of XML elements and attributes.
Tags
Annotators
URL
-
-
en.wikipedia.org en.wikipedia.org
-
an object-oriented approach to data modelling – where data is described in terms of classes, attributes, and associations
-
-
-
en.wikipedia.org en.wikipedia.org
-
Conceptual data model: describes the semantics of a domain, being the scope of the model. For example, it may be a model of the interest area of an organization or industry. This consists of entity classes, representing kinds of things of significance in the domain, and relationship assertions about associations between pairs of entity classes. A conceptual schema specifies the kinds of facts or propositions that can be expressed using the model. In that sense, it defines the allowed expressions in an artificial 'language' with a scope that is limited by the scope of the model.
-
"Data models for different systems are arbitrarily different. The result of this is that complex interfaces are required between systems that share data. These interfaces can account for between 25-70% of the cost of current systems".
-
The term data model can refer to two distinct but closely related concepts
-
A data model can sometimes be referred to as a data structure, especially in the context of programming languages.
-