npm init -y
Create a folder called src and add an empty index.js file. The code that webpack compiles goes in here including any Javascript modules and the main Tailwind file.
This step by step tutorial will show you how to set up a Node.js server with MongoDB to DigitalOcean using PM2, NGINX as reverse proxy and a SSL from LetsEncrypt. We will also add a custom domain name.
dotnet new blazorwasm -n BlazorJsSample |
<template> | |
<ins class="adsbygoogle" | |
:data-ad-client="adClient" | |
:data-ad-slot="adSlot" | |
:data-ad-format="adFormat" | |
:style="adStyle"></ins> | |
</template> | |
<script> | |
export default { |
<?php | |
/** | |
* This function uploads a file from a URL to the media library, designed to be placed in your own theme or plugin. | |
* Metadata will be generated and images will generate thumbnails automatically. | |
* | |
* HOW TO USE: | |
* 1. Add the function below to your theme or plugin | |
* 2. Call the function and provide the URL to an image or other file. | |
* 3. If successful, the attachment ID will be returned. |
import React, { Component } from "react"; | |
import { render } from "react-dom"; | |
import "./index.css"; | |
class Widget extends Component { | |
state = { text: "" }; | |
handleChange = (e) => { | |
this.setState({ text: e.target.value }); | |
}; | |
render() { |
Using the REST API to upload a file to WordPress is
quite simple. All you need is to send the file in a
POST
-Request to the wp/v2/media
route.
There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:
<script> | |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXXXXXX-XX', 'auto'); | |
ga('require', 'displayfeatures'); | |
ga('set', 'campaignSource', 'Facebook'); | |
ga('set', 'campaignMedium', 'Social Instant Article'); |
Here's a 'simple' way to get the YouTube subscriber number from Google's Youtube API v3: