Skip to content

Instantly share code, notes, and snippets.

Avatar

Ange Bagui angebagui

View GitHub Profile
@angebagui
angebagui / CustomerNotificationUtils.php
Last active May 15, 2020
CustomerNotificationUtils to push notification in Adjemin
View CustomerNotificationUtils.php
<?php
namespace App\Utils;
use App\Models\Customer;
use App\Models\CustomerDevice;
use App\Models\CustomerNotification;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
@angebagui
angebagui / ContactResult.dart
Last active Sep 7, 2019
ContactResult.dart
View ContactResult.dart
import 'package:socialapp/model/Contact.dart';
class ContactResult{
bool success;
List<Contact> data;
String message;
ContactResult({this.success, this.data, this.message});
View gist:e0ffa80222e06404cab6b847db5672ad
{
"items":[
{
"service_slug":"restaurant",
"quantity":2,
"cost":"2000.0",
"currency_code":"XOF",
"total_cost":"4000.0",
"meta_data":{
"restaurant_id":-1,
View gist:64b5ea0fd8e55b0d94b397a1ec3d2a06
Route::get('/foo', function () {
Artisan::call('storage:link');
});
@angebagui
angebagui / string-utils.js
Created Feb 8, 2018 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
View string-utils.js
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
/**
* "Safer" String.toLowerCase()
*/
function lowerCase(str){
return str.toLowerCase();
@angebagui
angebagui / Query : distance
Created Dec 8, 2017 — forked from dev-hpjsolutions/Query : distance
Calculate distance between two points
View Query : distance
<?php
// Permet d'obtenir les entrés contenu dans un rayon ($within)
$latitude = 45.545421;
$longitude = -73.59288;
$within = 100;
$query = "
SELECT `zip_code`, (6371 * acos(cos(radians($latitude)) * cos(radians(`lat`)) * cos(radians(`long`) - radians($longitude)) + sin(radians($latitude)) * sin(radians(`lat`))))
AS `distance`
@angebagui
angebagui / mongodb-s3-backup.sh
Created Dec 5, 2017 — forked from eladnava/mongodb-s3-backup.sh
Automatically backup a MongoDB database to S3 using mongodump, tar, and awscli (Ubuntu 14.04 LTS)
View mongodb-s3-backup.sh
#!/bin/sh
# Make sure to:
# 1) Name this file `backup.sh` and place it in /home/ubuntu
# 2) Run sudo apt-get install awscli to install the AWSCLI
# 3) Run aws configure (enter s3-authorized IAM user and specify region)
# 4) Fill in DB host + name
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket)
# 6) Run chmod +x backup.sh
# 7) Test it out via ./backup.sh
@angebagui
angebagui / gist:2180d587d5e1bea67d4d899a8e93e50c
Created Dec 5, 2017 — forked from adamstac/gist:7462202
Install and configure Sendmail on Ubuntu
View gist:2180d587d5e1bea67d4d899a8e93e50c

Install and configure Sendmail on Ubuntu

This should help you get Sendmail installed with basic configuration on Ubuntu.

  1. If sendmail isn't installed, install it: sudo apt-get install sendmail
  2. Configure /etc/hosts file: nano /etc/hosts
  3. Make sure the line looks like this: 127.0.0.1 localhost yourhostname
  4. Run Sendmail's config and answer 'Y' to everything: sudo sendmailconfig
  5. Restart apache sudo service apache2 restart
@angebagui
angebagui / mypays.json
Created Sep 3, 2017
http:localhost:8082/api/v1/countries
View mypays.json
// 20170903213159
// http://localhost:8082/api/v1/countries
[
{
"id": 1,
"indicatif_pays": 93,
"alpha2": "AF",
"alpha3": "AFG",
"nom_en_gb": "Afghanistan",
View puser.json
{"email":"", "password":"$2y$10$Gtwk0UOjZSu.edBqXX5Jvu/JZVCGB09qYdLiSQXhZpDklI8Zxb.na", "phrasecret":"", "locked":0, "id_fidele":201, "remember_token":"", "permission_gs":1, "permission_my":1}