Only allow orphans for the top most line in a div

Say we have a div with some text “Guided Helicopter Tours” as an example. Say the text is positioned to the bottom-left of a div 150h x 100w, whose width requires a word-wrap. The goal is to get it to break so orphans only exist for the top most line.

Normal wrapping :

"Guided Helicopter
Tours"

vs. what we want

"Guided
Helicopter Tours"

I’ll have no control over the titles, so I can’t hardcode <br>s or know how it will flow for any given device – any ideas?

How to fix Azure Pipelines Error TS2307 so I can push the program to IIS50 Server?

I am trying to release a program to our IIS Server, but I keep getting TS2307 Error at this stage in the pipeline:

  • task: VSBuild@1
    inputs:
    solution: ‘$(solution)’
    msbuildArgs: ‘/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation=”$(build.artifactStagingDirectory)WebApp.zip” /p:DeployIisAppPath=”Default Web Site”‘
    platform: ‘$(buildPlatform)’
    configuration: ‘$(buildConfiguration)’

I am not familiar with typescript and just want to push this up so others can view it. Is there any way I can accomplish this or solve these issues so I can push the program up?

I have read other posts on this error and tried to implement their solutions but to no success

Simplest way to open/close multiple pop-ups on the same page independently of one-another?

HTML

<dialog id="dialog-1" class="dialog">
<button class="close" autofocus>×</button>
<p>Thank you!</p>
</dialog>
<button class="button open">Click Here</button>

<dialog id="dialog-2" class="dialog">
<button class="close" autofocus>×</button>
<p>Thank you!</p>
</dialog>
<button class="button open">Click Here</button>

JS

const dialog = document.querySelector("dialog");
const showButton = document.querySelector("dialog + button");
const closeButton = document.querySelector("dialog button");
showButton.addEventListener("click", () => {
dialog.showModal();
});
closeButton.addEventListener("click", () => {
dialog.close();
});

Only the first dialog found on the page opens when clicked, but each respective dialog should open/close independently when interacted with.

using the swiper library, how to block the scroll position at the last slide with the releaseOnEdges option active?

I’m building a full-page slider using the Swiper library.

It works great, but I’m struggling with scroll behavior management at the end of the slider on desktop.

My requirements for desktop are:

  • Control the slider with mouse wheel and touchpad events
  • Force users to view each slide completely before allowing further scrolling
  • When reaching the final slide, release scroll control to resume normal page scrolling
  • When scrolling back up to the slider, reactivate the custom scroll behavior

The main issue is with how Swiper’s releaseOnEdges option handles scroll event release. The scroll is either completely blocked or released immediately upon reaching the last slide.

This creates problems with touchpad users (which I must support) on Windows and macOS. The touchpad’s momentum scrolling continues after reaching the last slide, causing users to jump from the first slide directly to the middle of the page when releaseOnEdges is enabled. Interestingly, this issue doesn’t occur on Ubuntu.

Here’s a CodeSandbox demonstrating the issue:

https://codesandbox.io/p/sandbox/swiper-mousewheel-control-forked-dn5jwg?file=%2Findex.html%3A81%2C32

What I tried:

  • Intercepting the scroll event previously triggered by swiper with the touchpad
    -> Can’t intercept a previously triggered event, or didn’t find how
  • Setting the window scroll position when getting to the last slide
    -> No effect
  • removing the releaseOnEdges options, and add a native event listener on wheel (the scroll will be blocked on the slider element unless swiper is disabled, based on what I saw) at the last slide after the transition has finised (slideChangeTransitionEnd) + add a set a timeout to try to absorb the touchpad momentum
    -> no effect, the event is triggered directly and the scroll event goes on

I may have missed a configuration option, or there might be a way to properly halt the scroll event at the last slide before releasing control back to the page. However, I haven’t found a solution yet.

Any suggestions would be greatly appreciated!

Thanks!

Looking for a working Instagram API or scraping tool with using javascript [closed]

I’m trying to fetch Instagram data using a hashtag search.
For each result, I need the following fields:

Username

Followers count

Image URL

Likes

Comments

It’s for development/testing purposes.

✅ If anyone has a working solution, even if it’s a paid one with a free tier or a scraping approach, please let me know.

Thanks in advance!

I’ve checked some APIs on RapidAPI, but most of them are either limited or outdated.

Running Kibana Functional Tests in Docker Fails with WebDriver: session not created (user-data-dir conflict)

I am developing my kibana plugin. I coded some tests which I can run in local easily like this:

TMPDIR=$HOME/tmp TEST_BROWSER_HEADLESS=0 yarn test --functional-test --testConfigFile ./test/functional/config.js

Now it is getting more complicated I want to run those tests in a Docker. I have a Dockerfile running kibana with my plugin working well. Then I try to run this bash script

cd plugins/my-plugin
CHROME_OUTPUT=$(npx @puppeteer/browsers install chrome@136)
npx @puppeteer/browsers install chromedriver@136
TEST_BROWSER_BINARY_PATH=$(echo "$CHROME_OUTPUT" | grep -oE '/.*chrome-linux64/chrome')
cd -

sudo apt install -y 
  default-jre 
  chromium-chromedriver

yarn es snapshot &
(NODE_OPTIONS="--max-old-space-size=4096" yarn start --no-base-path >startup.log &) &&
  while ! grep -q "Kibana is now available" "startup.log"; do
    echo "Pattern not found, checking again..."
    tail startup.log
    sleep 10
  done

TAGS=$1

if [ -z "TAGS" ]; then
  TMPDIR=$HOME/tmp TEST_BROWSER_BINARY_PATH=$TEST_BROWSER_BINARY_PATH TEST_BROWSER_HEADLESS=1 yarn --cwd plugins/my-plugin test --functional-test --testConfigFile ./test/functional/config.js
else
  TMPDIR=$HOME/tmp TEST_BROWSER_BINARY_PATH=$TEST_BROWSER_BINARY_PATH TEST_BROWSER_HEADLESS=1 yarn --cwd plugins/my-plugin test --functional-test --testConfigFile ./test/functional/config.js --tags "$TAGS"
fi

yarn test is running

node /home/.../kibana/scripts/functional_test_runner.js --config /home/.../my-config.js

Here is my-config.js

export default async function ({ readConfigFile }) {
  const functionalConfig = await readConfigFile(
    require.resolve(`${REPO_ROOT}/test/functional/config.base`)
  );

  const baseConfig = functionalConfig.getAll();
  return {
    // Inherit Kibana function test config
    ...baseConfig,
    services: {
      ...baseConfig.services,
      dataGridHelper: DataGridHelperService,
    },
    security: {
      ...baseConfig.security,
      disableTestUser: true,
    },
    servers: {
      kibana: {
        protocol: 'http',
        hostname: 'localhost',
        port: 5601,
        auth: 'elastic:changeme',
        username: 'elastic',
        password: 'changeme',
      },
      elasticsearch: {
        protocol: 'http',
        hostname: 'localhost',
        port: 9200,
        username: 'elastic',
        password: 'changeme',
        auth: 'elastic:changeme',
      },
    },
    testFiles: [require.resolve('./tests')],
    browser: {
      type: 'chrome',
    },
    uiSettings: { defaults: undefined },
    junit: {
      enabled: true,
      reportName: 'Table actions UX/UI Integration Tests',
    },
    screenshots: {
      directory: `${__dirname}/screenshots`,
    },
    snapshots: {
      directory: `${__dirname}/snapshots`,
    },
    failureDebugging: {
      htmlDirectory: `${__dirname}/failure_debug/html`,
    },
  };
}

So like I said in local on my machine it is working no problem but in my Docker container I have this error (actually it is in Jenkins):

 debg KIBANA_CI_STATS_CONFIG environment variable not found, disabling CiStatsReporter
 debg Loading config file from test/functional/config.js
 debg Loading config file from ../../test/functional/config.base.js
 debg Loading config file from ../../test/common/config.js
 debg Only running suites which are compatible with ES version 9.0.2
 debg randomness seed: 1750946212975
 debg [webdriver] Creating session
 warn Failure while creating webdriver instance
 warn SessionNotCreatedError: session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
          at Object.throwDecodedError (/home/.../kibana/node_modules/selenium-webdriver/lib/error.js:523:15)
          at parseHttpResponse (/home/.../kibana/node_modules/selenium-webdriver/lib/http.js:524:13)
          at Executor.execute (/home/.../kibana/node_modules/selenium-webdriver/lib/http.js:456:28)
          at processTicksAndRejections (node:internal/process/task_queues:95:5)
          at Executor.<anonymous> (prevent_parallel_calls.ts:49:14) {
        remoteStacktrace: '#0 0x5c1f64bff7fa <unknown>n' +
          '#1 0x5c1f646a3e90 <unknown>n' +
          '#2 0x5c1f646ddcfb <unknown>n' +
          '#3 0x5c1f646d9a3f <unknown>n' +
          '#4 0x5c1f64729c15 <unknown>n' +
          '#5 0x5c1f64729136 <unknown>n' +
          '#6 0x5c1f6471b013 <unknown>n' +
          '#7 0x5c1f646e7b3b <unknown>n' +
          '#8 0x5c1f646e87a1 <unknown>n' +
          '#9 0x5c1f64bc4b9b <unknown>n' +
          '#10 0x5c1f64bc8a8a <unknown>n' +
          '#11 0x5c1f64bac912 <unknown>n' +
          '#12 0x5c1f64bc9604 <unknown>n' +
          '#13 0x5c1f64b9174f <unknown>n' +
          '#14 0x5c1f64bed678 <unknown>n' +
          '#15 0x5c1f64bed856 <unknown>n' +
          '#16 0x5c1f64bfe666 <unknown>n' +
          '#17 0x73e869214ac3 <unknown>n'
      }

What could I have forget in the config.js or in the bash script

WordPress pixel code snippet for Follow Up Boss [closed]

I’m needing to put a pixel on our WordPress site for Follow Up Boss.

I installed WPcode, copied the code Follow Up Boss gave me, pasted it in, applied it to my site wide header, priority 10, but it’s not working. Below is the snippet of code they gave:

<!-- begin Widget Tracker Code -->
<script>
(function(w,i,d,g,e,t){w["WidgetTrackerObject"]=g;(w[g]=w[g]||function()
{(w[g].q=w[g].q||[]).push(arguments);}),(w[g].ds=1*new Date());(e="script"),
(t=d.createElement(e)),(e=d.getElementsByTagName(e)[0]);t.async=1;t.src=i;
e.parentNode.insertBefore(t,e);})
(window,"https://widgetbe.com/agent.js",document,"widgetTracker");
window.widgetTracker("create", "WT-MEUEPSGZ");
window.widgetTracker("send", "pageview");
</script> 
<!-- end Widget Tracker Code -->

How to dynamically render different Angular components with unique @Input() and @Output() bindings using createComponent()?

I’m building a dynamic UI engine in Angular (v15+) where I need to load different components at runtime based on configuration. These components each have different @Input() and @Output() properties.

What I’m trying to achieve:

Render multiple dynamic components using ViewContainerRef.createComponent()

Bind @Input() values dynamically (even though each component has different inputs)

Subscribe to @Output() events generically

Cleanly destroy or replace components when needed

    const componentConfigs = [
        {
            component: ButtonComponent,
            inputs: { label: 'Click Me' },
            outputs: { clicked: () => alert('Button clicked') },
        },
        {
            component: CardComponent,
            inputs: { title: 'Card Title', content: 'Lorem ipsum' },
            outputs: { selected: data => console.log(data) },
        },
    ];

    loadComponent(config) {
      const componentRef = this.container.createComponent(config.component);

     // How to set `@Input()` and bind `@Output()` safely?
    }

My Questions:

How can I dynamically bind arbitrary @Input() and @Output() properties using createComponent()?

Is there a type-safe or generic way to handle components with different input/output contracts?

What’s the best practice for cleaning up subscriptions from @Output() when destroying components?

This seems like a common requirement in CMS-style systems or dynamic form builders. Most examples show how to dynamically load one static component, but I’m looking for a flexible pattern that supports many components with unique bindings.

⨯ Error: 401 status code (no body) in NEXT JS after Build

I am getting the following error in next js

⨯ Error: 401 status code (no body)
at u.generate (.next/server/chunks/765.js:1:340449)
at ac.makeStatusError (.next/server/chunks/765.js:1:373620)
at ac.makeRequest (.next/server/chunks/765.js:1:374560)
at async o (.next/server/chunks/606.js:127:9282)
at async u (.next/server/chunks/606.js:127:8187)
at async A (.next/server/app/(home)/api/route.js:139:58546) {

There are no problems with server actions, api(s), Auth or anything else to the best of my knowledge.

The npm run dev works fine, but with npm run build, and then start this error occurs.

Major technologies being used in project(may or may not be related to the error): Prisma with Supabase Postgres, Next js, WorkOS Authkit, Dodo Payments API.

After npm run build and then npm run start, evrything works fine, but this error occurs and for some reason when on a VPS with dokploy, the Auth and Prisma don’t even work.

How to send custom data (e.g., site URL or user ID) with FastSpring webhook?

I’m integrating FastSpring with my WordPress plugin, and I’m using a webhook like this: https://example.com/wp-json/v1/webhook

Whenever a payment is completed in FastSpring, a webhook is triggered — for example, to example.com/wp-json/v1/webhook. This webhook can be called from anywhere, and I can use the data as needed.

Is there any way to insert custom data into this webhook — like siteURL or userID?

For instance, in the plugin code provided, can I somehow get the URL of the site where the plugin is installed, or the current user’s ID, from within the webhook handler?

<?php
/**
 * Plugin Name: Order Info
 * Description: Handle FastSpring payment.
 * Version: 1.0
 * Author: test
 */

if (!defined('ABSPATH')) exit;

/**
 * Admin Menu Page
 */
add_action('admin_menu', function () {
    add_menu_page(
        'Payment Manager',
        'Payment',
        'manage_options',
        'employee-payment-manager',
        'employee_payment_manager_page',
        'dashicons-admin-users',
        6
    );
});

/**
 * Admin Page Callback
 */
function employee_payment_manager_page() {
    ob_start();
    ?>
    <script
        id="fsc-api"
        src="https://d1f8f9xcsvx3ha.cloudfront.net/sbl/0.9.0/fastspring-builder.min.js"
        type="text/javascript"
        data-popup-webhook-received="dataPopupWebhookReceived"
        data-storefront="bwdplugins.test.onfastspring.com/popup-bwdplugins">
    </script>

    <div class="wrap">
        <h1>Payment Manager</h1>
        <p>
            <button onclick="addVariationAndCheckout('pcm-monthly')" class="wpcv-price-btn">
                Pay Monthly per User
            </button>
        </p>
    </div>

    <script>
        function dataPopupWebhookReceived(data) {
            console.log("Webhook received:", data);
        }

        function addVariationAndCheckout(variation) {
            fastspring.builder.reset();

            switch (variation) {
                case 'pcm-monthly':
                    fastspring.builder.add('pcm-monthly');
                    break;
                default:
                    break;
            }
            
            fastspring.builder.checkout();
        }
    </script>
    <?php
    echo ob_get_clean();
}

Serviceworker registration

We are trying to register a service worker in a domain a.abcorp.com. The site architecture is such a way that only the HTML loads from a.abcorp.com. All the other JS files and CSS files are loaded from b.abcorp.com. To optimize the performance, we want to prefetch some of the files from b.abcorp.com to improve page rendering time.

The problem I am facing is, cross-domain registration is not allowed for service workers. As we have a strict policy to load JS files from CDN, I am not able to load the service worker from b.abcorp.com

The second problem is, even if I somehow loaded the file from a.abcorp.com/xx/yy/zz path, I am still not able to intercept the calls to prefetch the files, as I have scope only for /xx/yy/zz

If I have to change the scope, I am getting an error that I cannot register the service worker in the root domain, unless the server side sends a header saying service-worker allowed.

For me to introduce new header, I will have to go to our IAM gateway and make changes.

If someone can help here in this multifold problem , would greatly appreciate.

Interaction_required: AADSTS161 Application requested user session which does not exist. Trace ID: xxx-xxx-x Correlation IDI xxxx-xxxx-xxxx-xxxxx

I’m using Azure AD authentication in a React.js app with MSAL.js (@azure/msal-browser). I’m encountering the following error intermittently (i.e., not every time):

Interaction_required: AADSTS1600231 Application requested user session which does not exist.  Trace ID: xxxx-xxxx-xxxx-xxxxx Correlation IDI xxxx-xxxx-xxxx-xxxxx Timestamp!

authconfig.js

import { LogLevel } from '@azure/msal-browser';

export const msalConfig = {
    auth: {
        clientId: process.env.AD_AUTH_CLIENT_ID,
        authority: 'https://login.microsoftonline.com/xxxx-xxxx-xxxx-xxxx/v2',
        redirectUri: '/',
        postLogoutRedirectUri: '/',
        navigateToLoginRequestUrl: false,
    },
    cache: {
        cacheLocation: 'localStorage',
        storeAuthStateInCookie: false,
    },
};

export const loginRequest = {
    scopes: [`${process.env.AD_AUTH_CLIENT_ID}/.default`],
};

export const graphConfig = {
    graphMeEndpoint: 'https://graph.microsoft.com/v1.0/me',
};

routes.tsx

export const msalInstance = new PublicClientApplication(msalConfig);
const accounts = msalInstance.getAllAccounts();
if (accounts.length > 0) {
    msalInstance.setActiveAccount(accounts[0]);
}

msalInstance.addEventCallback((event: EventMessage) => {
    if (event.eventType === EventType.LOGIN_SUCCESS && event.payload) {
        const payload = event.payload as AuthenticationResult;
        const account = payload.account;
        msalInstance.setActiveAccount(account);
    }
});

export const router = createBrowserRouter([
    {
        path: '/',
        element: <App pca={msalInstance} />,
        children: [myroutes],
    },
]);

Incremental build in Rollup 4

We have quite a big project with about 35k files, and many entries.
When we try to upgrade from v3 (3.28) to v4 (4.41) I get the following observations:

Initial build time got better for ~25% (200s => 150s)
The startup got faster for a few seconds as well.
But I get the issue with the rebuild when it runs.

I starts taking 30-40s instead of 5-10s earlier.
It feels like there are some issues with the incremental build or something like that.

Is there something that made things work differently ?
Probably we have tune our plugins/configs/whatever

Any help is appreciated. Thank you!

How to make stockfish play weaker using javascript

I am trying to make a chess game . I am using stockfish to play a game with bot. Its working fine .i am using this option along with depth 1 to make stockfish weaker

stockfish.postMessage("setoption name Skill Level value 1);
  stockfish.postMessage("setoption name Skill Level Maximum Error value 250);
  stockfish.postMessage("setoption name Skill Level Probability value 100); 

But when i use above option i get this

No such option: Skill Level Maximum Error
No such option: Skill Level Probability

Maybe i am using wrong javascript file. Please tell me which github stockfish resposrity and which javascript file i should use to play it weaker.currently i am using this github release

https://github.com/lichess-org/stockfish.js/releases/tag/ddugovic-250718

But it always play strong . I want to make some levels to play. But changing depth option doesn’t do much .i want to use it on mobile browser . I tried other stockfish js resposrity too but same problem.please help me