This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
""" | |
Will backup all the databases listed, will put files in same DIR as script' | |
To run: $ python dbbackup.py OR python3 dbbackup.py | |
""" | |
import configparser | |
import os | |
import time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:async'; | |
import 'dart:convert'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:http/http.dart' as http; | |
Future<List<Result>> fetchResults(http.Client client) async { | |
final response = await client.get('https://api.myjson.com/bins/j5xau'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To manually dump the database you can run the following one-liner code | |
mysqldump -u[user] -p[pass] [db] > [file_path] | |
But what if you want to automate the process, here are the steps: | |
1. Setup cron entry to your server | |
* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1 | |
2. Create a command BackupDatabase by running the following code: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:io'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter_absolute_path/flutter_absolute_path.dart'; | |
import 'package:multi_image_picker/multi_image_picker.dart'; | |
class FetchImage with ChangeNotifier { | |
List<File> _files; | |
List<String> _list; | |
List<File> get files => _files; | |
List<String> get list => _list; |