by xero updated 10.29.24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AssetHeaders | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
request = Rack::Request.new(env) | |
response = @app.call(env) | |
if request.path =~ /^\/assets\// | |
# there maybe a better way to add headers |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dm_display_wpjm_categories () { | |
$terms = get_terms( array( | |
'taxonomy' => 'job_listing_category', | |
'hide_empty' => false, | |
) ); | |
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){ | |
echo '<ul>'; | |
foreach ( $terms as $term ) { | |
echo '<li>' . '<a href="' . esc_url( get_term_link( $term ) ) . '">' . $term->name . '</a></li>'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Meter = function (props) { | |
var { | |
percent = 0, // a number between 0 and 1, inclusive | |
width = 100, // the overall width | |
height = 10, // the overall height | |
rounded = true, // if true, use rounded corners | |
color = "#0078bc", // the fill color | |
animate = false, // if true, animate when the percent changes | |
label = null // a label to describe the contents (for accessibility) | |
} = props; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Meter = function (props) { | |
var { | |
percent = 0, // a number between 0 and 1, inclusive | |
width = 100, // the overall width | |
height = 10, // the overall height | |
rounded = true, // if true, use rounded corners | |
color = "#0078bc", // the fill color | |
animate = false, // if true, animate when the percent changes | |
label = null // a label to describe the contents (for accessibility) | |
} = props; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import type { ActionFunctionArgs, LoaderFunctionArgs } from '@remix-run/node'; | |
import { | |
ClientActionFunctionArgs, | |
ClientLoaderFunctionArgs, | |
useFetcher, | |
useLoaderData, | |
} from '@remix-run/react'; | |
import { enqueueActions, fromPromise, setup } from 'xstate'; | |
import { useActor } from '@xstate/react'; | |
import { useEffect, useRef } from 'react'; |