Categories
Mastering Development

How to send request using a field in DjangoRestFramework UI

I am making a request from some external source, I am successfully able to make the request both manually by passing the "reference_no" in my url, but I will like to have a way whereby I can put the "reference_no" in the DRF UI and click on post which would send the data to the […]

Categories
CMS Mastering Development Wordpress

Facebook embeds fixing with functions.php

I use this code to solve the new Instagram embeds problem on my old WordPress site: add_filter(‘oembed_providers’, ‘fr_replace_deprecated_instagram_api’, 10, 1); function fr_replace_deprecated_instagram_api($providers) { unset($providers[‘#https?://(www\.)?instagr(\.am|am\.com)/(p|tv)/.*#i’]); $providers[‘#https?://(www\.)?instagr(\.am|am\.com)/(p|tv)/.*#i’] = array(‘https://graph.facebook.com/v8.0/instagram_oembed’, true); return $providers; } // You need to create a developer account for Facebook’s API and grant permission for the "OEmbed" App. define(‘FR_FACEBOOK_APP_ID’, ‘APP_ID’); define(‘FR_FACEBOOK_CLIENT_SECRET’, ‘CLIENT_SECRET’); define(‘FR_FACEBOOK_TOKEN_URI’, ‘https://graph.facebook.com/oauth/access_token?client_id=’ […]

Categories
Mastering Development

How to append a Ajax variable obtained from a loop into a tag

Hi everyone i’m new to Ajax,i’m using ajax to get values from my database in form of an object array from a separate PHP file and displaying them in a table,everything works fine,but i want to create a link and append the ID obtained from the array so that i can send a GET request […]

Categories
Mastering Development

How to Change Django Homepage with Your Custom Design?

I am trying to change django default homepage with my custom design, but it’s not working. I Try a lot but still the same issue, I am not Understanding what is the issue, it’s working perfect on my local server, But I am implementing Django app on Live server, Please let me know where I […]

Categories
Mastering Development

how to update multiple record using ajax using checbox in laravel php?

consider i have csid = [1 , 2 , 3] and area_id = 10 i want to assign area id to cs id so i tried this code this code get all user ids in (var ids = []) and get area-select and pass to ajax but it response 500 error $(‘#change_area_multiple’).on(‘click’, function () { […]

Categories
CMS Mastering Development Wordpress

Embed video from streamtape using direct link

Good Afternoon, i want to embed this video in my wordpress https://streamtape.com/v/7qDqGjlQe4UA9MR/Soul_Land_03_VOSTFR.mp4 Embed code <iframe src="https://streamtape.com/e/7qDqGjlQe4UA9MR/Soul_Land_03_VOSTFR.mp4" width="800" height="600" allowfullscreen allowtransparency allow="autoplay" scrolling="no" frameborder="0"></iframe> I have tried to paste the following code in my theme function.php file but it doesn’t function. I would be very happy to receive your help add_action( ‘init’, function() { wp_embed_register_handler( ‘streamtape’, […]

Categories
CMS Mastering Development Wordpress

How to use

I am a beginner in WordPress development looking to build a block with tab navigation using <LinkControl />. I am still learning, so any guidance/materials/code examples will be appreciated. My question is, if I have multiple <LinkControl />, how would I check the current index of that <LinkControl /> in order to set the attributes? […]

Categories
Mastering Development

ansible search and replace strings or replace block of text

I have a file with that looks like this: <Resource name="X1" auth="Container" type="javax.sql.DataSource" username="yyyy" password="yyyyy" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:yyyyy/yyyyy@yyyy:yyyy/yyyy" validationQuery="SELECT 1 from dual"/> <Resource name="Y2" auth="Container" type="javax.sql.DataSource" username="xxx" password="xxxx" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:yyyy/yyyyy@yyyyy:yyyyyy/yyyy" validationQuery="SELECT 1 from dual"/> I need to replace in the second (Y2) Resource the driverClassName, url, validationQuery values. So it will look like this: <Resource name="jdbc/Y2" […]

Categories
Mastering Development

React Hook Dependencies – Generic Fetch Hook

I’ve followed many tutorials for how to set up my own custom generic useFetch hook. What I came up with works well, but it is breaking some Rules of Hooks. Mostly, it doesn’t use the "correct" set of dependencies. The generic hook accepts a url, options, and dependencies. Setting the dependencies up as all three […]

Categories
Raspberry Pi User Help

rc.local not able to execute python script with network code

(Disclaimer, this is a crosspost from my Unix & Linux Overflow question, however I got no answers) To introduce my problem, I’m running Raspbian Stretch on a RPi 3 model B+, and I have two scripts that I run in /etc/rc.local so that the pi can run completely headless and control a GoPro over wifi […]