- Sep 2024
-
-
It's a fork of Memery gem. Original Memery uses prepend Module.new with memoized methods, not touching original ones. This approach has advantages, but also has problems, see discussion here: tycooon#1
-
- Jul 2024
-
security.stackexchange.com security.stackexchange.com
-
I’ve implemented a form on the landings page that auto-submits (on DOMContentLoaded) and posts the token to the next page. Passwordless login is now working for my client despite their mail scanner.
-
- May 2024
-
mattbrictson.com mattbrictson.com
-
If you are okay with the user appending arbitrary query params without enforcing an allow-list, you can bypass the strong params requirement by using request.params directly:
-
- Apr 2024
-
kb.mozillazine.org kb.mozillazine.org
-
The "All Mail" folder in a Gmail IMAP account has a copy of all messages for that account, doubling the number of messages downloaded for offline folders. Thunderbird tries to download only one copy of a message from a Gmail IMAP account and have the folders point to that copy. However, that doesn't help if the message was created using Thunderbird. [1] If you decide to keep offline folders enabled and have a Gmail IMAP account, uncheck "All Mail" in Tools -> Account Settings -> Account Name -> Synchronization & Storage -> Advanced. As a precaution right click on the Gmail account name in the folder pane, select subscribe in the context menu, expand the folder listing and verify the All Mail folder is not subscribed. Disabling it from being synced should have unsubscribed it. Exit Thunderbird and delete "All Mail." and "All Mail.msf" in the accounts local directory.
-
- Mar 2024
-
www.reddit.com www.reddit.com
-
I found this strange too. I de-linked all the bills and subscriptions from the budget (spending plan) in Simplifi and added them to the planned expense section. After that, the budget is more Mint like for me.
-
- Feb 2024
-
meta.stackoverflow.com meta.stackoverflow.com
-
As you've seen, there is no DM system, but you can invite users to chat directly. More generally, consider commenting on the question itself and @-ing the user who made the edit(s). To my understanding, this should work, and it may allow for a quick explanation that doesn't require going in to chat.
I think commenting in the context of question is better than a DM, though I don't always like making my question "messy" by having a bunch of comments under it... but maybe that is the best way.
-
- Jan 2024
-
www.ruby-forum.com www.ruby-forum.com
-
def ===(other) @holder == other end
-
- Dec 2023
-
gitlab.com gitlab.com
-
Enable ActiveRecord unsigned integers to use 8 bytes instead of 4. This fixes the ActiveModel::RangeError problem where AR models with perfectly fine 8 bytes primary keys are taken for ActiveModel::Type::Integer with a default limit of 4 bytes.
-
- Jun 2023
-
help.openai.com help.openai.com
-
Shared links offer a new way for users to share their ChatGPT conversations, replacing the old and burdensome method of sharing screenshots.
-
-
developers.google.com developers.google.com
-
If a user denies consent, tags no longer store cookies but instead send signals to the Google Server as described in the next section. This prevents the loss of all information about visitors who deny consent and it enables Google Analytics 4 properties to model conversions as described in About modeled conversions.
-
- Feb 2023
-
apple.stackexchange.com apple.stackexchange.com
-
But, since they'll automatically encode in rich text if there are any HTML tags placed in the message by the device itself, putting a single space ( ) in the signature via the mail app itself, and then bold/italic-izing said space makes it work.
-
-
stackoverflow.com stackoverflow.com
-
You can simulate a pre-checkout git hook:
-
- Nov 2022
-
developer.mozilla.org developer.mozilla.org
-
If you need to encode Unicode text as ASCII using btoa(), one option is to convert the string such that each 16-bit unit occupies only one byte.
-
-
stackoverflow.com stackoverflow.com
-
session = ActionDispatch::Integration::Session.new(Rails.application) response = session.post("/mypath", my_params: "go_here")
worked for me
-
-
stackoverflow.com stackoverflow.com
-
module InjectSession include Warden::Test::Helpers def inject_session(hash) Warden.on_next_request do |proxy| hash.each do |key, value| proxy.raw_session[key] = value end end end end
-
- Sep 2022
-
json-schema.org json-schema.org
-
A workaround you can use is to move additionalProperties to the extending schema and redeclare the properties from the extended schema.
-
-
stackoverflow.com stackoverflow.com
-
This is telling the browser that the width of #header should be 100% with a padding of 30px. Since padding is not counted into the width, the actual width ends up to be 100% + 60px. So, in order to make sure this fits into the page, you need to subtract 60px (30px to the left + 30px to the right) from the 100% width and it will fit into the browser. Luckily you are easily able to do this with CSS: #header{ padding: 30px; width: calc(100% - 60px);
-
- Jun 2022
-
stackoverflow.com stackoverflow.com
-
This actually is possible with JavaScript, though browser support would be spotty. You can use XHR2 to download the file from the server to the browser as a Blob, create a URL to the Blob, create an anchor with its href property and set it to that URL, set the download property to whatever filename you want it to be, and then click the link. This works in Google Chrome, but I haven't verified support in other browsers. window.URL = window.URL || window.webkitURL; var xhr = new XMLHttpRequest(), a = document.createElement('a'), file; xhr.open('GET', 'someFile', true); xhr.responseType = 'blob'; xhr.onload = function () { file = new Blob([xhr.response], { type : 'application/octet-stream' }); a.href = window.URL.createObjectURL(file); a.download = 'someName.gif'; // Set to whatever file name you want // Now just click the link you created // Note that you may have to append the a element to the body somewhere // for this to work in Firefox a.click(); }; xhr.send();
-
- May 2022
-
github.com github.com
-
The shared context worked though thanks! RSpec.shared_context "perform_enqueued_jobs" do around(:each) { |example| perform_enqueued_jobs { example.run } } end RSpec.configure do |config| config.include_context "perform_enqueued_jobs" end
use case for around
Tags
Annotators
URL
-
- Apr 2022
-
edgeguides.rubyonrails.org edgeguides.rubyonrails.org
-
You need to tell the main autoloader to ignore the directory with the overrides, and you need to load them with load instead. Something like this: overrides = "#{Rails.root}/app/overrides" Rails.autoloaders.main.ignore(overrides) config.to_prepare do Dir.glob("#{overrides}/**/*_override.rb").each do |override| load override end end
-
-
-
FWIW, I'm using triggers to get around AR's habit of sending NULL instead of DEFAULT: create function medias_insert_make_uuid() returns trigger as $$ begin NEW.uuid := random_characters(12); return NEW; end $$ language plpgsql; create trigger medias_insert_make_uuid before insert on medias for each row execute procedure medias_insert_make_uuid();
Tags
Annotators
URL
-
- Mar 2022
-
-
$: bodyStyle = ` <style> body { background-color: ${backgroundColor.hex} } </style> `;
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
The cleanest is to give up on readonly properties and instead use some kind of mapping that turns an object into something you really can only read from, via something like getter functions.
-
- Feb 2022
-
-
Note that render_wizard does attempt to save the passed object. This means that in the above example, the object will be saved twice. This will cause any callbacks to run twice also. If this is undesirable for your use case, then calling assign_attributes (which does not save the object) instead of update might work better.
acceptable
-
-
github.com github.com
-
As a workaround, you can use setters in every affected reactive block instead of direct assignment. let localForm = {}; const setLocalForm = (data) => { localForm = data; }; $: setLocalForm({...$formData});
Tags
Annotators
URL
-
- Jan 2022
-
github.com github.com
-
Oh, I just figured out a workaround for my project, in case it helps someone. If you want the source of truth on the prop to come from the child component, then leave it undefined in the parent. Then, you can make the reactive variable have a condition on the presence of that variable. eg: <script> let prop; $: prop && console.log(prop); </script> <Child bind:prop/> Might not work for every use case but maybe that helps someone.
-
- Nov 2021
-
developer.mozilla.org developer.mozilla.org
-
Fixing with containIf we give each article the contain property with a value of content, when new elements are inserted the browser understands it only needs to recalculate the containing element's subtree, and not anything outside it:
-
-
-
(you can get pretty far with <svelte:component> and passing component constructors around and spicing up props along the way)
-
-
svelte.dev svelte.dev
-
If you need to pass multiple arguments to an action, combine them into a single object, as in use:longpress={{duration, spiciness}}
-
- Oct 2021
-
stackoverflow.com stackoverflow.com
-
Please note that gtk-launch requires the .desktop file to be installed (i.e. located in /usr/share/applications or $HOME/.local/share/applications). So to get around this, we can use a hackish little bash function that temporarily installs the desired .desktop file before launching it. The "correct" way to install a .desktop file is via desktop-file-install but I'm going to ignore that.
-
-
guides.rubyonrails.org guides.rubyonrails.org
-
Applications can safely autoload constants during boot using a reloader callback: Rails.application.reloader.to_prepare do $PAYMENT_GATEWAY = Rails.env.production? ? RealGateway : MockedGateway end Rails.application.reloader.to_prepare do $PAYMENT_GATEWAY = Rails.env.production? ? RealGateway : MockedGateway end Copy That block runs when the application boots, and every time code is reloaded.
workaround to problem described earlier
-
- Sep 2021
-
stackoverflow.com stackoverflow.com
-
Or use a '?' in place of a space as long as there are no other matching filenames than the one with spaces (since '?' matches any character): rsync -av host:a?long?filename /tmp/
-
-
stackoverflow.com stackoverflow.com
-
As a work-around I know add a listener to the document-head and move what gets added to the shadow-root.
-
-
stackoverflow.com stackoverflow.com
-
An #each tag can loop anything with a length property, so: {#each {length: 3} as _, i} <li>{i + 1}</li> {/each} will also work, if you prefer.
-
-
stackoverflow.com stackoverflow.com
-
One good use for /dev/tty is if you're trying to call an editor in a pipeline (e.g., with xargs). Since the standard input of xargs is some list of files rather than your terminal, just doing, e.g., | xargs emacs will screw up your terminal. Instead you can use | xargs sh -c 'emacs "$@" </dev/tty' emacs to connect the editor to your terminal even though the input of xargs is coming from elsewhere.
-
-
askubuntu.com askubuntu.com
-
One solution is to run this command to reset your keyring password: rm ~/.local/share/keyrings/login.keyring
-
- Aug 2021
-
github.com github.com
-
const allRoles: string[] = Object.values(Role)
helped me!
-
-
github.com github.com
-
If you really want to prevent people from passing in known Cat instances to isDog() you can fake up a lower-bound type parameter constraint like this:
-
-
stackoverflow.com stackoverflow.com
-
Or, maybe better, interpret the list as a tuple type: const list: ['a','b','c'] = ['a','b','c']; // tuple
-
You can force the type system to remember each value as a literal string: const list = ['a' as 'a','b' as 'b','c' as 'c']; // infers as ('a'|'b'|'c')[]
-
-
github.com github.com
-
In javascript prettier-ignore ignores the next block, so what I did was just make the next few lines a block.
-
-
www.ruby-lang.org www.ruby-lang.org
-
foo({}, **{}) #=> Ruby 2.7: [{}] (You can pass {} by explicitly passing "no" keywords)
-
- Jun 2021
-
sveltematerialui.com sveltematerialui.com
-
Use this to build a ClassAdder component. ClassAdder components are useful for reducing the size of your bundle. If you have tons of simple components that just need to add classes/props or set a context, using ClassAdder components means there's only one "big" Svelte component in your bundle for all of these many tiny components.
-
This is useful when you need to add classes to a component, since Svelte's "class:" directives don't work on components.
-
-
github.com github.com
-
This change should be a workaround for issue #8.
-
-
github.com github.com
-
Worth noting that in the case where you're proxying /api/ requests to an external server in nginx you can easily do this in handle today:
-
-
github.com github.com
-
I don't know how much workaround is it, but for now I'm using this approach:
Looks like a catch-all
api/[...route]
internal endpoint that proxies to the real external API server. -
If you do need to passthrough your mydomain.com cookies to a thirdparty.com domain, you can technically already do that now by implementing it as an endpoint and calling fetch('/my-endpoint')
-
- May 2021
-
github.com github.com
-
on CSR it connects to the svelte-kit endpoint which just use a localhost connection. and to optimize this you can use unix sockets in your endpoints to connect to backend server
-
-
stackoverflow.com stackoverflow.com
-
Thanks. Worked for me. I needed to move the merged directory into a sub-folder so after following the above steps I simply used git mv source-dir/ dest/new-source-dir
-
-
stackoverflow.com stackoverflow.com
-
You may want to try putting the one-liner (everything in the single quotes) in an actual script, with a bash shebang line. I think filter-branch is probably trying to run this in sh, not bash.
-
-
jakedeichert.com jakedeichert.com
-
The super hacky alternative... using an error's stack trace When I got this to work I literally laughed out loud 😂. It might be the most hacky solution to a problem I've found yet
-
-
en.wikipedia.org en.wikipedia.org
-
Large regions of memory can be allocated without the need to be contiguous in physical memory – the IOMMU maps contiguous virtual addresses to the underlying fragmented physical addresses. Thus, the use of vectored I/O (scatter-gather lists) can sometimes be avoided.
-
- Apr 2021
-
expect.sourceforge.net expect.sourceforge.net
-
unbuffer disables the output buffering that occurs when program output is redirected. For example, suppose you are watching the output from a fifo by running it through od and then more. od -c /tmp/fifo | more You will not see anything until a full page of output has been produced. You can disable this automatic buffering as follows: unbuffer od -c /tmp/fifo | more
-
-
unix.stackexchange.com unix.stackexchange.com
-
But we can use a two characters delimiter: / (space slash) That pair of characters could only exist at the beginning of a new (absolute) path:
-
-
github.com github.com
-
Mentioned here:
but I can't find it on my system
-
-
bugzilla.samba.org bugzilla.samba.org
-
The script support/rsync-no-vanished that will be in the next release.
-
-
stackoverflow.com stackoverflow.com
-
Another possible solution would be to use a class Common instead of a module. But this is just a workaround.
-
-
css-tricks.com css-tricks.com
-
stackoverflow.com stackoverflow.com
-
fill_in('Foo', with: 'bar', fill_options: { clear: :backspace })
first sighting: fill_options: { clear: :backspace })
first sighting: fill_options as an option at all (for
fill_in
only, I presume)I wonder they added at all as a response to this:
See also: https://hyp.is/ZcXVJJMyEeucgmPXYFP9yg/github.com/teamcapybara/capybara/issues/203
(which key should have been pressed, backspace, space?)
-
-
github.com github.com
-
It might be possible to fix it in Capybara, but I'm afraid that we'd just add more unexpected, ambiguous behaviour (which key should have been pressed, backspace, space?).
-
Here's another workaround:
-
find_field('Prefix').send_keys([:control, "a"], :backspace)
-
- Mar 2021
-
askubuntu.com askubuntu.com
-
Now, if you also want deskopen to pass through any command-line parameters, you can instead use this slightly-modified version: #!/bin/sh desktop_file=$1 shift `grep '^Exec' "${desktop_file}" | sed 's/^Exec=//' | sed 's/%.//'` "$@" &
-
-
store.steampowered.com store.steampowered.com
-
Works also on Linux if you install Steam for Windows on Wine.
-
-
api.rubyonrails.org api.rubyonrails.org
-
Note that autosave will only trigger for already-persisted association records if the records themselves have been changed. This is to protect against SystemStackError caused by circular association validations.
-
-
github.com github.com
-
You'll still get the correct backtrace, and can use that to view your own sources locally though.
Tags
Annotators
URL
-
-
github.com github.com
-
To achieve this, we created a small Compressor which wraps the Uglifier compressor and links the source maps so they are written to disk.
Tags
Annotators
URL
-
- Feb 2021
-
github.com github.com
-
To correct this, you can move these files to some subdirectory of ./app/assets/stylesheets or javascripts; or you can change the manifest.js to be more like how Rails with Sprockets 3 works, linking only the specific application files as top-level targets
-
-
github.com github.com
-
Some developers found work arounds by using virtual attributes to # skip validators
-
-
-
I have developed a simple pattern that copies errors from the model or the service into the form object so that the view can still use those errors
-
-
support.system76.com support.system76.com
-
Windows and Linux store their time in the BIOS differently, this will cause your clock to be desynchronized when you switch from one OS to the other. The easiest solution for it is to fix it in Linux, forcing it to work the same way as Windows. You can do this through the terminal:
-
-
github.com github.com
-
github.com github.com
-
A.joins(:b) .where( A.arel_table[:something_a].eq('xxx').or(B.arel_table[:something_b].eq('yyy')) )
-
-
alistapart.com alistapart.com
-
stackoverflow.com stackoverflow.com
-
on the other hand, documents from different origins can still communicate using window.postMessage(), for example to implement collaborative iframe auto-resizing.
-
- Jan 2021
-
stackoverflow.com stackoverflow.com
-
You could use an asymmetrical border to make curves with CSS. border-radius: 50%/100px 100px 0 0;
-
-
css-tricks.com css-tricks.com
-
The solution is min-width: 0; on the flex child Or min-width some actual value. Without this, the flex child containing the other text elements won’t narrow past the “implied width” of those text elements.
Tags
Annotators
URL
-
-
-
Change any of the <option> by double clicking on the number.
-
-
webapps.stackexchange.com webapps.stackexchange.com
-
I want to create a filter for all email sent by me only to me. To accomplish this I send all these "notes" to a permutation that I know no one else uses. E.g. john__doe@gmail.com
-
-
css-workshop.com css-workshop.com
-
How to wrap long word (text without spaces) in html table’s cell? This is very, very easy! We must add only a CSS proprty to table cell “td” tag – “word-break: break-all;” then all column’s widths become as intended.
-
-
www.impressivewebs.com www.impressivewebs.com
-
use of the border-box property. If you add the following at the top of your CSS file, you should be able to avoid many of the problems inherent in using 100% width on your elements:
Tags
Annotators
URL
-
-
-
Interesting . That feature (<slot slot="..."/>) was only recently added in #4295. It wasn't primarily intended to be used that way, but I guess it's a good workaround for this issue. I'm yet to find caveats to slotting components that way, other than it's inconvenient, as opposed to <Component slot="..."/>.
-
-
github.com github.com
-
Related to #1824, can do <svelte:component this={Bar}> <slot></slot> <slot name="header" slot="header"></slot> </svelte:component> <script> import Bar from './Bar.svelte'; </script> as a forwarding workaround
-
-
svelte.dev svelte.dev
-
Not exactly sure when I would use this, but seems like it could be useful.
-
-
github.com github.com
-
Can't find the Svelte way of doing this, setTimeout helps now, but this is not a good way working with a framework I think.
-
-
github.com github.com
-
Or just watch the value with a reactive statement instead of an event handler on the input like: $: inputValue, onInput() This is a good solution and seems to work in all cases.
-
-
github.com github.com
-
Note: your arrow must be an HTMLElement (not an SVGElement). To use an SVG arrow, wrap it in a <div> tag with the data-popper-arrow attribute.
Tags
Annotators
URL
-
-
atomiks.github.io atomiks.github.io
-
If an element is disabled, you will need to use a wrapper element (<span> or <div>) in order for the tippy to work.
Tags
Annotators
URL
-
- Dec 2020
-
github.com github.com
-
I guess it's about "preloading" and not "navigation", if it's the case, then I guess there is still no way to attach to navigation events, and this issue should be kept open.
-
No JS event is fired, so there currently isn't any clean way to do this that I can see.
-
-
sapper.svelte.dev sapper.svelte.dev
-
delete is a reserved word in JavaScript. To handle DELETE requests, export a function called del instead.
Tags
Annotators
URL
-
-
github.com github.com
-
As a workaround for the need of having more than 1 root nodes for the same slot, we can introduce the <svelte:slot> as a wrapper:
-
-
-
Slot element doesn't support bind:this, but it's fallback child does.
-
- Nov 2020
-
stackoverflow.com stackoverflow.com
-
If you want a reference to the global object that works in any context, you can read this from a directly-called function. const global = (function() {return this})();. This evaluates to window in the browser, self in a service worker and global in nodejs.
-
-
github.com github.com
-
You can either use require to bypass typescript special import.
-
-
www.youtube.com www.youtube.com
-
Hadn't realized I needed to go through PayPal and was stuck using the higher prices on the USPS site.
-
- Sep 2020
-
-
Currently, I can only do this with some ugly JS, by wrapping the <slot> in a div and then selecting all direct children of that div (div>*). But this fix/solution also makes me face a problem: The <div> partially destroys the layout/design compared to when not using that div wrapper.
-
- Apr 2020
-
github.com github.com
Tags
Annotators
URL
-