14.17.020.9.02.6.83.2.21.9.41.15.63.7.103.11.6The Free plan lets you run a single non-highly available Redis database with up to 30MB and 30 connections, forever (or as long as you use it)! It lets you run Redis Enterprise Cloud in a selected region across all three major public clouds (Amazon Web Services, Microsoft Azure, and Google Cloud). You can use all available Redis modules: RediSearch, RedisJSON, RedisGraph, RedisTimeSeries, and RedisBloom. Best of all, it’s totally free, no credit card required.
https://redis.com/blog/new-pricing-for-redis-enterprise-cloud/
| Heroku | Render | |
|---|---|---|
| Sleeps after | 30 minutes of inactivity | 15 minutes of inactivity |
| Free Tier | 550 dyno hours/month | 750 hours of running time |
| No of apps/services in free tier | 5 | no limitations |
{
"rules": {
"coaches": {
".read": true,
".write": "auth != null"
},
"requests" : {
"•read": "auth != null",
".write": true
}
}
}
$ composer create-project drupal/recommended-project:9.3.1 my_site_name_dir
This will create a project in 'my_site_name_dir' and automatically executes composer install to download the latest stable version of Drupal and all its dependencies.
Your 'my_site_name_dir' will contain files that should be outside of your web root and not accessible by the web server. The web root will be 'my_site_name_dir/web'.
$ composer require. drupal/php
Clone the below repo
https://github.com/apfromiit/drupal9
and run $ composer install
$ sudo chmod +777 web/sites/default/files
Copy default.settings.php to settings.php
$ sudo chmod +777 web/sites/default/settings.php
Open in browser to complete the setup.
$ sudo chmod 755 web/sites/default/settings.php
Now, adding tags to article will render the article in corresponding page.
We can remove the unwanted blocks by deleting them on the context menu provided on top right corner of every blocks.
web/ with your static website.composer.json with {}composer.lock<app-name>| Category | Problems |
|---|---|
| Peer | 13053 |
| Beginner | 434 |
| Easy | 1359 |
| Medium | 1057 |
| Hard | 469 |
| Challenge | 147 |
| Total | 16519 |
Running scripts on your computer is great. Running them automatically is even greater. If you are on a Mac (or
Linux), you can use our good friend crontab, which is a scheduling tool that will run jobs
(scripts) at regular intervals.
You add a job to crontab by editing the job list. A job is specified in the following format (first line):
* * * * * command to execute │ │ │ │ │ │ │ │ │ └─── day of week (0 - 6) (0 to 6 are Sunday to Saturday, or use names; 7 is Sunday, the same as 0) │ │ │ └──────── month (1 - 12) │ │ └───────────── day of month (1 - 31) │ └────────────────── hour (0 - 23) └─────────────────────── min (0 - 59)
Let's make an example job. I personally use cronjobs to make regular backups of my MySQL databases, so I will show how to set this up to run once a day.
My script is called backup.sh,
and will dump my MySQL database to a zip file. We'll set it to run as a cronjob by editing the job list (with
the nano editor):
env EDITOR=nano crontab -e
Now enter the following and press CTRL+O and CTRL+X to save and exit.
0 12 * * * cd ~/my/backup/folder && ./backup.sh
This will execute the command every day at 12:00, which changes to the folder of the script and runs it. The
double ampersand && allows you to specify multiple commands that will run after each other.
Notice that if your computer is shut down or sleeping at the time, the script will not run until the next day at the specified time.
To see a list of your active crontab jobs, use the following command:
crontab -l
You might get a weird "command not found" error when running your crontab jobs for the first time, even though the script works fine when you run it yourself. That's because crontab executes commands without any of the normal environment variables set up.
To fix this, you can add the PATH in the beginning of your script, so it knows how to find programs like
mysqldump:
#!/bin/sh
PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin
So after you've set up your scripts and everything is honky dory, you might notice that the Terminal suddenly have started sending you e-mails.
If being pen pals with your Terminal isn't your thing, you can disable this behavior by inserting this line at the very top of your crontab file:
MAILTO=""
Presto. Now your jobs will run silent.
Here's a few small snippets which might come in handy:
| Description | Script |
|---|---|
| Execute on workdays 1AM | 0 1 * * 1-5 /bin/execute/this/script.sh |
| Execute every 10 minutes | */10 * * * * /bin/execute/this/script.sh |
| Log output to file | */10 * * * * /bin/execute/this/script.sh >> /var/log/script_output.log 2>&1
|
db.json and commitNote: Changes to db are non persistent. Heroku free dyno would become idle if no api request for 30 minutes. Heroku loads original db on next cold start.
JSONPlaceholder is a free online REST API that you can use whenever you need some fake data. It can be in a README on GitHub, for a demo on CodeSandbox, in code examples on Stack Overflow, ...or simply to test things locally.
JSONPlaceholder comes with a set of 6 common resources:
| /posts | 100 posts |
| /comments | 500 comments |
| /albums | 100 albums |
| /photos | 5000 photos |
| /todos | 200 todos |
| /users | 10 users |
Note: resources have relations. For example: posts have many comments, albums have many photos, ... see guide for the full list.
All HTTP methods are supported. You can use http or https for your requests.
| GET | /posts |
| GET | /posts/1 |
| GET | /posts/1/comments |
| GET | /comments?postId=1 |
pip install firebase-admin
Goto Project Settings -> Service Accounts -> Click Generate new private key and save the file as credentials.json
import firebase_admin, json
from firebase_admin import credentials, db
cred = credentials.Certificate("credentials.json")
firebase_app = firebase_admin.initialize_app(cred, {
'databaseURL': 'https://<projectid>-default-rtdb.firebaseio.com'
})
with open("data.json") as json_file:
data = json.load(json_file)
ref = db.reference("sample_key")
ref.set(data)
firebase_admin.delete_app(firebase_app)
import firebase_admin
from firebase_admin import credentials, db
cred = credentials.Certificate("credentials.json")
firebase_app = firebase_admin.initialize_app(cred, {
'databaseURL': 'https://<projectid>-default-rtdb.firebaseio.com'
})
ref = db.reference("sample_key")
data = ref.get()
firebase_admin.delete_app(firebase_app)
{
"rules": {
".read": false,
".write": false
}
}
2. Click on the (+) icon to add an item to the list. Press command+shift+G to open the Go to Folder… dialog, type /usr/sbin/cron and press Enter:
3. Select the cron file and click Open:
That’s it!
declare const PR: any;
ngAfterViewChecked() {
PR.prettyPrint();
}
Styles:
li.L0, li.L1, li.L2, li.L3,
li.L5, li.L6, li.L7, li.L8 {
list-style-type: decimal !important;
}
pre.prettyprint {
border-radius: 0;
white-space: pre;
}
Template:
<pre class="prettyprint linenums lang-cpp">
...
Place the code here
...
</pre>