- May 2024
-
git.doit.wisc.edu git.doit.wisc.edu
-
bdi->dev = NULL; kref_init(&bdi->refcnt); bdi->min_ratio = 0; bdi->max_ratio = 100 * BDI_RATIO_SCALE; bdi->max_prop_frac = FPROP_FRAC_BASE; INIT_LIST_HEAD(&bdi->bdi_list); INIT_LIST_HEAD(&bdi->wb_list); init_waitqueue_head(&bdi->wb_waitq); bdi->last_bdp_sleep = jiffies;
Initial config settings
-
- Nov 2023
-
-
ActiveRecord::Base.serialize no longer uses YAML by default. YAML isn't particularly performant and can lead to security issues if not used carefully. Unfortunately there isn't really any good serializers in Ruby's stdlib to replace it. The obvious choice would be JSON, which is a fine format for this use case, however the JSON serializer in Ruby's stdlib isn't strict enough, as it fallback to casting unknown types to strings, which could lead to corrupted data. Some third party JSON libraries like Oj have a suitable strict mode.
-
- Aug 2023
-
stackoverflow.com stackoverflow.com
-
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.
-
- Jun 2023
-
stackoverflow.com stackoverflow.com
-
I'm not saying never mark methods private. I'm saying the better rule of thumb is to "make methods protected unless there's a good reason not to".
-
-
developers.google.com developers.google.com
-
By default, Google tags use automatic cookie domain configuration. Cookies are set on the highest level of domain possible. For example, if your website address is blog.example.com, cookies are set on the example.com domain.
-
- Jan 2023
-
bugs.ruby-lang.org bugs.ruby-lang.org
-
I'm still against frozen-string-literal by default. It is arguable if the string creation limits performance so much in real-world programs. We need to first measure how much Ruby can be faster by frozen-string-literal. If it is not significant, Ruby should prefer dynamics and flexibility.
-
-
- Dec 2022
-
github.com github.com
-
I assume that the goal of synchronizing timestamps is so that the primary record and its Version can be correlated by future reporting queries. I've always thought this is an odd feature, given that said correlation can be more reliably and performantly achieved by use of the foreign key (item_id). So, I'd like to suggest that we add an option to disable this feature. For the new option's name, I'll suggest synchronize_version_creation_timestamp. It would be true by default. has_paper_trail(synchronize_version_creation_timestamp: false) I'm open to disabling this feature by default, in a future major release, after a reasonable deprecation period.
-
- Nov 2022
-
-
So when configuring Capybara, I'm using ignore_default_browser_options, and only re-use this DEFAULT_OPTIONS and exclude the key I don't want Capybara::Cuprite::Driver.new( app, { ignore_default_browser_options: true, window_size: [1200, 800], browser_options: { 'no-sandbox': nil }.merge(Ferrum::Browser::Options::Chrome::DEFAULT_OPTIONS.except( "disable-features", "disable-translate", "headless" )), headless: false, } )
-
-
github.com github.com
-
git_workspace/ ├── .vscode │ └── settings.json # global settings, my preferred ones ├── my-personal-projects/ │ └── project1/ │ └── .git/ └── company-projects/ ├── .vscode │ └── settings.json # local settings, overrides some of my personal ones ├── project2/ │ └── .git/ └── project3/ └── .git/
-
-
stackoverflow.com stackoverflow.com
-
Changing the second line to: foo.txt text !diff would restore the default unset-ness for diff, while: foo.txt text diff will force diff to be set (both will presumably result in a diff, since Git has presumably not previously been detecting foo.txt as binary).
comments for tag: undefined vs. null: Technically this is undefined (unset,
!diff
) vs. true (diff
), but it's similar enough that don't need a separate tag just for that.annotation meta: may need new tag: undefined/unset vs. null/set
-
-
github.com github.com
-
# check for the expected command if [ "$1" = 'mongod' ]; then # init db stuff.... # use gosu (or su-exec) to drop to a non-root user exec gosu mongod "$@" fi # else default to run whatever the user wanted like "bash" or "sh" exec "$@"
-
-
hub.docker.com hub.docker.com
-
Note: This repo does not publish or maintain a latest tag. Please declare a specific tag when pulling or referencing images from this repo.
-
- Sep 2022
-
github.com github.com
-
The RuboCop way is to offer an opinion in the way of a good default, but to accommodate all reasonable style choices.
-
-
datatracker.ietf.org datatracker.ietf.org
-
This specification reserves the use of one URI as a problem type: The "about:blank" URI [RFC6694], when used as a problem type, indicates that the problem has no additional semantics beyond that of the HTTP status code. When "about:blank" is used, the title SHOULD be the same as the recommended HTTP status phrase for that code (e.g., "Not Found" for 404, and so on), although it MAY be localized to suit client preferences (expressed with the Accept-Language request header). Please note that according to how the "type" member is defined (Section 3.1), the "about:blank" URI is the default value for that member. Consequently, any problem details object not carrying an explicit "type" member implicitly uses this URI.
annoying limitation
have to come up with unique (and unchanging?) URIs up front
otherwise (if type is omitted), this restrictive "about:blank" URI is assumed by default
-
-
stackoverflow.com stackoverflow.com
-
git -c log.follow= log: that will unset log.follow, just for that one git log instance.
-
If we ever moved a file to a different location or renamed it, all its previous history is lost in git log, unless we specifically use git log --follow. I think usually, the expected behavior is that we'd like to see the past history too, not "cut off" after the rename or move, so is there a reason why git log doesn't default to using the --follow flag?
-
-
stackoverflow.com stackoverflow.com
-
Note: Git 2.6+ (Q3 2015) will propose that in command line: see "Why does git log not default to git log --follow?" Note: Git 2.6.0 has been released and includes this feature. Following path changes in the log command can be enabled by setting the log.follow config option to true as in: git config log.follow true
-
- Aug 2022
-
github.com github.com
-
Thus my docs recommendation of public function beforeFilter(Event $event) // do not render out the now inconsistent one for is(json) if (!$this->request->is('jsonapi')) { throw new NotFoundException('Invalid access, use application/vnd.api+json for Content-Type and Accept.'); } } to specifically only whitelist the desired jsonapi for the general use case.
-
A default baked app has all those included. Thats why I am saying this - it is by default an issue we should and need to address :)
-
- Jul 2022
-
stackoverflow.com stackoverflow.com
-
Create a new controller to override the original: app/controllers/active_storage/blobs_controller.rb
Original comment:
I've never seen monkey patching done quite like this.
Usually you can't just "override" a class. You can only reopen it. You can't change its superclass. (If you needed to, you'd have to remove the old constant first.)
Rails has already defined ActiveStorage::BlobsController!
I believe the only reason this works:
class ActiveStorage::BlobsController < ActiveStorage::BaseController
is because it's reopening the existing class. We don't even need to specify the
< Base
class. (We can't change it, in any case.)They do the same thing here: - https://github.com/ackama/rails-template/pull/284/files#diff-2688f6f31a499b82cb87617d6643a0a5277dc14f35f15535fd27ef80a68da520
Correction: I guess this doesn't actually monkey patch it. I guess it really does override the original from activestorage gem and prevent it from getting loaded. How does it do that? I'm guessing it's because activestorage relies on autoloading constants, and when the constant
ActiveStorage::BlobsController
is first encountered/referenced, autoloading looks in paths in a certain order, and finds the version in the app'sapp/controllers/active_storage/blobs_controller.rb
before it ever gets a chance to look in the gem's paths for that same path/file.If instead of using autoloading, it had used
require_relative
(or evenrequire
?? but that might have still found the app-defined version earlier in the load path), then it would have loaded the model from activestorage first, and then (possibly) loaded the model from our app, which (probably) would have reopened it, as I originally commented.
-
- Aug 2021
-
github.com github.com
-
Why not just prettier-ignore? Because I want to keep Prettier here. Still format my code. But just with another config. This already works with prettierrc > overrides. But this proposal is for a better usability and flexibility.
-
-
github.com github.com
-
Using a flag to disable prettier for a line, the next line or until I activate it again (ESLint like syntax). // prettier-disable border: { sep: "║", topLeft: "╔", topMid: "╦", top: "═", topRight: "╗", midLeft: "╠", midMid: "╬", mid: "═", midRight: "╣", botLeft: "╚", botMid: "╩", bot: "═", botRight: "╝" }, // prettier-enable
-
- Jun 2021
-
github.com github.com
-
Runs headless by default, but you can configure it to run in a headful mode.
first sighting of term: headful
-
-
basarat.gitbook.io basarat.gitbook.ioClasses1
-
If an access modifier is not specified it is implicitly public as that matches the convenient nature of JavaScript 🌹.
-
- May 2021
-
stackoverflow.com stackoverflow.com
-
Normally, git diff looks for non-printable characters in the files and if it looks like the file is likely to be a binary file, it refuses to show the difference. The rationale for that is binary file diffs are not likely to be human readable and will probably mess up your terminal if displayed. However, you can instruct git diff to always treat files as text using the --text option. You can specify this for one diff command: git diff --text HEAD HEAD^ file.txt You can make Git always use this option by setting up a .gitattributes file that contains: file.txt diff
-
-
kit.svelte.dev kit.svelte.dev
-
By default, the SvelteKit runtime intercepts clicks on <a> elements and bypasses the normal browser navigation for relative (same-origin) URLs that match one of your page routes. We sometimes need to tell SvelteKit that certain links need to be handled by normal browser navigation.
-
-
docs.gitlab.com docs.gitlab.com
-
By default, groups created in: GitLab 12.2 or later allow both Owners and Maintainers to create subgroups. GitLab 12.1 or earlier only allow Owners to create subgroups.
-
- Apr 2021
-
github.com github.com
-
This approach is preferable to overriding authenticate_user! in your controller because it won't clobber a lot of "behind the scenes" stuff Devise does (such as storing the attempted URL so the user can be redirected after successful sign in).
-
- Mar 2021
-
www.jackfranklin.co.uk www.jackfranklin.co.uk
-
Svelte is different in that by default most of your code is only going to run once; a console.log('foo') line in a component will only run when that component is first rendered.
Tags
- trying to doing things the same way you did in a different library/framework (learning new way of thinking about something / overcoming habits/patterns/paradigms you are accustomed to)
- opinionated
- turning things around / doing it differently
- unfortunate defaults
- difference
- Svelte vs. React
- important point
- reasonable defaults
- opinion
Annotators
URL
-
-
askubuntu.com askubuntu.com
-
If you call ./configure --enable-gui=auto, the build process will automatically build against whichever GUI libraries are available. A cursory glance suggests that gtk2 will be prioritised over gnome2.
-
-
github.com github.comd3/d31
-
The default bundle combines about thirty of these microlibraries.
-
-
github.com github.com
-
I totally understand that there may be a majority still considering this a bad practice and thus keeping it disabled by default in production seem ok. But there could at least be an option to enable it for people who want to, no?
-
-
stackoverflow.com stackoverflow.com
-
Knowing what your elements are lets browsers use sensible defaults for how they should look and behave. This means you have less customization work to do and are more likely to get consistent results in different browsers.
-
-
-
The input is required and initially empty, so on page load the input is :invalid and border is red. :( :(The input is :invalid until you type a legit email address, so it is red when typing. :( :(Ok, so the :invalid pseudo selector is kind of useless. Ideally we would not show an error up front or the whole time they are typing, just when they submit something unacceptable.
-
- Feb 2021
-
en.wikipedia.org en.wikipedia.org
-
Because the Berne Convention in most countries by default grants copyright holders monopolistic control over their creations, copyright content must be explicitly declared free, usually by the referencing or inclusion of licensing statements from within the work.
-
-
askubuntu.com askubuntu.com
-
Instead of modifying /usr/share/applications/google-chrome.desktop, the file can be copied into ~/.local/share/applications/google-chrome.desktop and modified without root access. This file will take precedence over the global desktop file.
-
-
github.com github.com
-
Record filters allow you to require an instance of a particular class (or one of its subclasses) or a value that can be used to locate an instance of the object. If the value does not match, it will call find on the class of the record. This is particularly useful when working with ActiveRecord objects.
-
-
github.com github.com
-
def initialize(attributes=nil) self.assign_attributes(attributes) end
-
-
css-tricks.com css-tricks.com
-
If no end line value is declared, the item will span 1 track by default.
-
-
alistapart.com alistapart.com
-
Just like in flexbox, this will move the displayed grid items out of source order, placing them after the grid items that don’t have explicit order values.
-
- Jan 2021
-
coreos.com coreos.comCoreOS1
-
The advantage of the first method is that one easily overrides the complete unit, the default Container Linux unit is not parsed at all anymore.
-
-
stackoverflow.com stackoverflow.com
-
After command, then we need to first reset the command withAfter= and then add our commands.
-
-
github.com github.com
-
premailer-rails processes all outgoing emails by default. If you wish to skip premailer for a certain email, simply set the :skip_premailer header:
-
- Nov 2020
-
stackoverflow.com stackoverflow.com
-
As was mentioned in the comments above, the material design spec for buttons specifies that the text should be uppercase, but you can easily override its CSS property: paper-button { text-transform: none; }
-
-
github.com github.com
-
github.com github.com
-
logInfoToStdOut (boolean) (default=false) This is important if you read from stdout or stderr and for proper error handling. The default value ensures that you can read from stdout e.g. via pipes or you use webpack -j to generate json output.
-
-
stackoverflow.com stackoverflow.com
-
The problem is that by default, module paths only work with things imported via npm because the new modules variable on resolve defaults to ["node_modules"]. This lets you import 3rd party code from npm really easily. But it means importing your code with a module path needs a config change.
-
-
github.com github.com
-
This is linux. Ouput first, formatting second. systemctl --no-pager -l should be the default.
-
- Oct 2020
-
stackoverflow.com stackoverflow.com
-
Why doesn't it do this by itself, by default?
-
-
softwareengineering.stackexchange.com softwareengineering.stackexchange.com
-
Right, and if most uses of an FTP service use new FtpService() the one that sets an alternate port will stand out (service.SetPort(12345))
-
The concept of Convention over Configuration is impossible without sensible default values. The key word here is "sensible". The default values have to make sense for at least 80% (if not more) of all the uses of a library/service/framework.
-
- Jul 2020
-
blog.toshima.ru blog.toshima.ru
-
To stop emitting the warnings, just add RUBYOPT=-W:no-deprecated.
-
- Jun 2020
-
makandracards.com makandracards.com
-
However, a ActiveRecord::Rollback within the nested transaction will be caught by the block of the nested transaction, but will be ignored by the outer transaction, and not cause a roll back! To avoid this unexpected behaviour, you have to explicitly tell rails for each transaction to indeed use proper nesting: CopyActiveRecord::Base.transaction(joinable: false, requires_new: true) do # inner code end This is a safer default for working with custom transactions.
-
- Jan 2020
-
www.lmdb.tech www.lmdb.tech
-
The default behavior is to enter the new key/data pair, replacing any previously existing key if duplicates are disallowed, or adding a duplicate data item if duplicates are allowed (MDB_DUPSORT).
-
- Oct 2019
-
www.rubyraptor.org www.rubyraptor.org
-
Setting up Nginx properly requires quite a bit of work. Using websockets or using Rails streaming? Make sure you disable response buffering for the relevant URIs, otherwise they won’t work correctly. Phusion Passenger 5’s builtin reverse proxy does the right thing by default, without any configuration. In other words: it’s all about making things simple.
-
-
github.com github.com
-
Yes, absolutely, no two projects are alike. This step is moving towards a direction where we have a set of best practices for webpack isolated in a bundled package and can be maintained in isolation without impacting upgrades or end-user experience. If you have seen next.js or create-react-app they sort of do they same thing for ease and maintainability. Rails is a great example for this - there are some built-in best practices, opinionated defaults and gems that are hidden behind the scene plus power to do advance things where needed.
-
- Jan 2014
-
sandofsky.com sandofsky.com
-
If you’re fighting Git’s defaults, ask why. Treat public history as immutable, atomic, and easy to follow. Treat private history as disposable and malleable. The intended workflow is: Create a private branch off a public branch. Regularly commit your work to this private branch. Once your code is perfect, clean up its history. Merge the cleaned-up branch back into the public branch.
Good defaults are sometimes hard to recognize, especially when the tool is complex.
Questioning the defaults-- and deciding why you would keep them or change them-- is a good antidote to dismissing something due to not understanding it.
If you can't understand why you don't like the defaults, then decide what you would choose instead and why you would change the default as it stands. Does the default make it easy to do the "right" thing AND hard to do the "wrong" thing? The second part of that statement is the most important since it might not be obvious what the "right" thing is.
Even if you don't like the defaults, ask yourself if they continually lead you away from perils and problems that would plague you if a different set of defaults were chosen?
Tags
Annotators
URL
-