Categories
CMS Drupal Mastering Development

Ajax Response Proxy server cache error

Im having hard time to debug the ajax response using custom form, it works on my local but not work on cloud . Is this related to caching ? This are the responses on different environment cloud => Cache-Control: max-age=0, no-store, private localhost => Cache-Control: max-age=0, no-store, private, must-revalidate, no-cache, private

Categories
Mastering Development

how to control html/php session timeouts on different pages

Updated, see the section regarding Symfony session configuration in PHP.ini I have a website that contains multiple pages that are created using PHP and the Symphony v2.8 framework. For most of the pages in my website the default HTML/PHP session timeout is fine, but I have a couple of webpages that I’d like to keep […]

Categories
CMS Mastering Development Wordpress

How to cascade Gutenberg SelectControl component

How can I cascade the SelectControl component in Gutenberg editor. My exact requirement is as following: My first select list contains post meta fields and on the second select list, I want to display the posts that have the post meta that was selected in the first select list. I use getEntityRecords with custom query […]

Categories
CMS Drupal Mastering Development

hook_menu_local_tasks_alter is not invoked during functional tests

I have an implementation of hook_menu_local_tasks_alter in my module, which works fine on my dev environment, but when I try to run my module using BrowserTestBase the hook is not invoked when visiting a node. Why? Here is a mock instance of the hook that I’ve set up just to see if the hook is […]

Categories
Mastering Development

How to launch maximised window of Safari Browser in Nightwatch

Nightwatch Configuration file: "globals_path":"./nightwatch/global.js", "detailed_output":true, "disable_colors":false, "output_folder":"./tests_output", "webdriver":{ "start_process":true }, "selenium":{ "start_process":true, "port":4444, "host":"localhost", "server_path":"./node_modules/selenium-server-standalone-jar/jar/selenium-server-standalone-3.141.59.jar", "log_path":"", "version2":true, "cli_args":{ "webdriver.gecko.driver":"./node_modules/geckodriver/bin/geckodriver", "webdriver.chrome.driver":"./node_modules/chromedriver/lib/chromedriver/chromedriver", "webdriver.safari.driver":"/usr/bin/safaridriver" } }, "test_settings":{ "default":{ "launch_url":"https://www.google.com", "silent":true, "skip_testcases_on_fail":false, "end_session_on_fail":false, "screenshots":{ "enabled":true, "path":"./screenshots" }, "webdriver":{ "start_process":true, "server_path":"/usr/bin/safaridriver", "port":0, "cli_args":[ "–verbose" ] }, "desiredCapabilities":{ "browserName":"Safari", "javascriptEnabled":true, "acceptSslCerts":true, "safari.options":{ "excludeSwitches":[ "enable-automation" ], "args":[ "start-maximized", "window-size=1980,1024", "–disable-web-security", "–disable-notifications", "–private" […]

Categories
Mastering Development

Issues trying to use If-None-Match with Etag in Android

Always returns code 200 (response ok) when it should be 304. Here is my example code. import okhttp3.ResponseBody import retrofit2.Response import retrofit2.http.GET import retrofit2.http.Header import retrofit2.http.Streaming import retrofit2.http.Url interface DownloadService { @Streaming @GET suspend fun downloadResourceIfNoneMatch( @Url url: String, @Header("If-None-Match") vararg eTags: String ): Response<ResponseBody?> } Here’s my OkHttpClient that I am using: val cacheSize: […]

Categories
User Help

How to fix a suspended instagram account?

Today a hacker messaged me and threaten to close my instagram account (common personal posts, 10 years from creation date, 200 followers, private, 2-factor auth enabled) I resisted. Within minutes I was logged out and now when I log in a message like this appear: "Thanks for Providing Your Info We’ll review your info and […]

Categories
User Help

Why aren’t my self-signed certificates working for HTTPS on localhost

I have this in Node.js: const http2 = require(‘http2’) const fs = require(‘fs’) let server start({ port: process.env.PORT || 3000, private: fs.readFileSync(‘/Users/me/certs/localhost.key’).toString(), public: fs.readFileSync(‘/Users/me/certs/localhost.crt’).toString() }) async function start(opts) { server = await createServer(opts) } async function createServer({ port, private, public, password }) { return new Promise((res, rej) => { let server = http2.createSecureServer({ key: private, […]

Categories
CMS Magento Mastering Development

Magento2 need to check if varnish cache is applied or not

How can I verify whether my Varnish Cache is properly configured or not. Here are the things that appeared page_cache is not getting regenerated Site speed as per Google page speed is improved My site is set on http://x.x.x.x & is redirected to https://x.x.xx.x HTTP/1.1 200 OK < Date: Wed, 22 Jul 2020 13:59:25 GMT […]

Categories
Mastering Development

Syntax-Highlighting for Java-Code in html

What I am trying to do I am working on a syntax-highlighter that highlights java-code in html (example below). Example output I’ve tested the code with the following java-code (caesar-encryption): //Encryption public static String encrypt(String text, int n) { int x = 0; int y = 0; String out = ""; //Empty string for result. […]