- Sep 2024
-
github.com github.com
-
mount IndexController do # all methods will be mounted automatically, it's just an example of refinement get '/hello', :hello_world end
-
- Dec 2023
-
-
Compared with simple clients, modern clients are generally much easier to use and more Ruby-like
-
Modern clients are produced by a modern code generator, combined with hand-crafted functionality for some services.
-
- Dec 2022
-
github.com github.com
-
Dilemma: Do I use this unofficial library with its really nice idiomatic API or the official library (https://github.com/mailgun/mailgun-ruby) with its inferior API?
I wish this one was still/better maintained because I'd much rather use this API, like:
@mailgun.lists.create "devs@your.mailgun.domain" @mailgun.lists.list @mailgun.lists.find "devs@your.mailgun.domain"
but it's not maintained, and looks like it doesn't have the word
events
in the source at all, so it's missing any way to use the Events API. :(
-
- Aug 2022
-
stackoverflow.com stackoverflow.com
-
you can also replicate the bind:this syntax if you please: Wrapper.svelte <script> let root export { root as this } </script> <div bind:this={root} />
This lets the caller use it like this:
<Wrapper bind:this={root} />
in the same way we can already do this with elements:
<div bind:this=
-
- Nov 2021
-
www.linuxuprising.com www.linuxuprising.com
-
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepoflatpak install flathub org.chromium.Chromium
-
- May 2021
-
github.com github.com
-
From now just use url instead of asset-url
-
- Apr 2021
-
github.com github.com
-
logger.tag_formatter.default(Lumberjack::Formatter.new.clear.add(Object, :inspect)) logger.tag_formatter.default(Lumberjack::Formatter::InspectFormatter.new) logger.tag_formatter.default { |value| value.inspect }
-
There are several built in classes you can add as formatters. You can use a symbol to reference built in formatters. logger.formatter.add(Hash, :pretty_print) # use the Formatter::PrettyPrintFormatter for all Hashes logger.formatter.add(Hash, Lumberjack::Formatter::PrettyPrintFormatter.new) # alternative using a formatter instance
-
# This will register formatters only on specific tag names logger.tag_formatter.add(:thread) { |thread| "Thread(#{thread.name})" } logger.tag_formatter.add(:current_user, Lumberjack::Formatter::IdFormatter.new)
Tags
Annotators
URL
-
- Mar 2021
-
trailblazer.to trailblazer.to
-
Currently, I’m working on designing the interfaces and it’s real fun!
-
-
github.com github.com
-
var md = require('markdown-it')('commonmark');
first sighting: require(...)(...)
How would that work with import? Not as fluidly but...
import markdownIt from 'markdown-it' let md = markdownIt('commonmark')
-
-
trailblazer.to trailblazer.to
-
patch: -> { step Destroy.method(:tidy_storage), before: :delete_model }
-
- Feb 2021
-
trailblazer.to trailblazer.to
-
Subprocess will try to match the nested ends’ semantics to the tracks it knows. You may wire custom ends using Output.
-
-
-
I agre with your concern. I realy prefer to do this : form.assign_attributes(hash) if form.valid? my_service.update(form) #render something else #render somthing else end It looks more like a normal controller.
-
-
github.com github.com
-
Finally, you can use fields_for in order to create/edit associated fields and the suffix _list (like profile_list below) to choose an existing associated record.
-
@user_form = UserForm.new(User.find(params[:id])) # you need to load the record being edited
-
# Use relationship's name followed by "__" plus attribute's name # to validate has_one and belongs_to associations validates :name, :address__street, :company__name, presence: true
-
-
apidocs.getresponse.com apidocs.getresponse.com
Tags
Annotators
URL
-
- Dec 2020
-
sapper.svelte.dev sapper.svelte.dev
-
page is a { host, path, params, query } object where host is the URL's host, path is its pathname, params is derived from path and the route filename, and query is an object of values in the query string.
I like that we don't have to manually parse params/query out of the full request URI. It provides the data that you are most likely to need, in an readily/easily-usable form.
Tags
Annotators
URL
-
-
github.com github.com
-
I think the main difference between the two are the way API are served. Some smelte components need you to input big chunk of json as props, while i prefer keep props as primitive types and in the other hand give you different components tags to compose.
-
- Oct 2020
-
rob-blackbourn.medium.com rob-blackbourn.medium.com
-
Much better API than using openssl CLI directly (yuck).
-
-
www.basefactor.com www.basefactor.com
-
return { type: "COUNTRY_BLACK_LIST", succeeded, message: succeeded ? "" : "This country is not available" }
-
-
masteringjs.io masteringjs.io
-
You can set options.params to a POJO as shown above, or to an instance of the JavaScript's built-in URLSearchParams class. const params = new URLSearchParams([['answer', 42]]); const res = await axios.get('https://httpbin.org/get', { params });
-
- Sep 2020
-
react-spectrum.adobe.com react-spectrum.adobe.comuseFocus1
-
let {focusProps} = useFocus({ onFocus: (e) => setEvents((events) => [...events, 'focus']), onBlur: (e) => setEvents((events) => [...events, 'blur']), onFocusChange: (isFocused) => setEvents((events) => [...events, `focus change: ${isFocused}`]) });
-