Skip to content

Instantly share code, notes, and snippets.

View thukuwanjiku's full-sized avatar
👓
Focusing

thukuwanjiku thukuwanjiku

👓
Focusing
  • Kenya
View GitHub Profile
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;
@akhileshdarjee
akhileshdarjee / scheduling mysql backups with laravel.php
Created April 22, 2019 14:10
Scheduling MySQL backups with Laravel
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:
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');
@trafficinc
trafficinc / dbbackup.py
Last active March 8, 2024 04:26
Python script for taking mysqldump
#!/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