Skip to content

Instantly share code, notes, and snippets.

@ducminhn
ducminhn / backup.sh
Created November 10, 2022 07:09 — forked from Meldiron/backup.sh
Backup and Restore Appwrite, the lazy way 🐌
# Make sure to stop Appwrite before this backup,
# and make sure you have enough space on the machine.
# After backing up, make sure there is a file in 'backups/backup-___.tar.gz'.
# Also please check size of this file, it should be at least 5kb, even for small instances.
docker run --rm \
-v appwrite_appwrite-mariadb:/backup/appwrite-mariadb \
-v appwrite_appwrite-redis:/backup/appwrite-redis \
-v appwrite_appwrite-cache:/backup/appwrite-cache \
@ducminhn
ducminhn / gravityxl-scheduled-export-entry.php
Created April 9, 2019 22:15 — forked from xlplugins/gravityxl-scheduled-export-entry.php
Schedule Export for Gravity Forms Entries
<?php
/**
* @package Gravity XL Scheduled Entries Export
* @version 1.0
* @name gravityxl -scheduled-entries-export
* @author Gravity XL
*/
/**
* Schedule gform Entry export
*
@ducminhn
ducminhn / nginx-tuning.md
Created February 1, 2019 19:26 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@ducminhn
ducminhn / generators.md
Created March 29, 2016 04:02 — forked from learncodeacademy/generators.md
What are Javascript Generators?

##what are generators##

  • They're pausable functions, pausable iterable functions, to be more precise
  • They're defined with the *
  • every time you yield a value, the function pauses until .next(modifiedYieldValue) is called
var myGen = function*() {
  var one = yield 1;
  var two = yield 2;
  var three = yield 3;
 console.log(one, two, three);