Skip to content

Instantly share code, notes, and snippets.

View gausoft's full-sized avatar
🏠
Working from home

Gauthier Eholoum gausoft

🏠
Working from home
View GitHub Profile
/*
Most map tile providers use 256px square tiles so Leaflet's basic zoom algorithm looks like this:
256 * Math.pow(2, zoom);
If you're working with vector layers you can extend one of leaflet's default CRSs
and make it return tile sizes in smaller increments. This can be very helpful when using
fitBounds() with layer groups, so the zoomed group fits better within the map bounds:
E.g., extending L.CRS.EPSG3857 (the default CRS):
@gausoft
gausoft / ejabberd init.d script
Created April 16, 2018 16:28
A startup script for ejabberd
#! /bin/sh
#
# ejabberd Startup script for the ejabberd server
#
# chkconfig: 345 15 85
# description: The ejabberd instant messaging server is software to communicate \
# and collaborate in real-time between two or more people based on typed text
# processname: ejabberd
set -o errexit
@gausoft
gausoft / paginate.php
Last active January 10, 2020 13:08 — forked from ctf0/paginate.php
Laravel Paginate Collection or Array
<?php
// use Illuminate\Support\Collection;
// use Illuminate\Pagination\Paginator;
// use Illuminate\Pagination\LengthAwarePaginator;
/**
* Génère la pagination des éléments dans un tableau ou une collection.
*
* @param array|Collection $items
@gausoft
gausoft / force-https-in-htaccess
Created February 5, 2020 09:59 — forked from koffisani/force-https-in-htaccess
Pour forcer l'utilisation d'une connexion SSL sur votre site web
###############################################
#Pour forcer l'utilisation d'une connexion SSL sur votre site web, veuillez placer le contenu suivant dans un fichier .htaccess
###############################################
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R=301,L]
@gausoft
gausoft / force-https-in-htaccess
Created February 5, 2020 09:59 — forked from koffisani/force-https-in-htaccess
Pour forcer l'utilisation d'une connexion SSL sur votre site web
###############################################
#Pour forcer l'utilisation d'une connexion SSL sur votre site web, veuillez placer le contenu suivant dans un fichier .htaccess
###############################################
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{SERVER_NAME}/$1 [R=301,L]
@gausoft
gausoft / gist:3142059b7c837fc77b25f1e944e0525b
Created April 4, 2020 15:24 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
<?php
namespace Tests\Feature;
use App\User;
use Tests\TestCase;
use Livewire\Livewire;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Testing\RefreshDatabase;
@gausoft
gausoft / Fancy Button - Flutter
Created June 30, 2020 08:37 — forked from mkiisoft/Fancy Button - Flutter
Fancy Button made for Flutter Games and Apps
import 'package:flutter/material.dart';
class FancyButton extends StatefulWidget {
const FancyButton({
Key key,
@required this.child,
@required this.size,
@required this.color,
this.duration = const Duration(milliseconds: 160),
this.onPressed,
@gausoft
gausoft / README.md
Created August 15, 2020 07:45 — forked from CodingDoug/README.md
Patterns for security with Firebase Authentication: offload work to Cloud Functions

This is the runnable sample code from the blog post [Patterns for security with Firebase Authentication: offload work to Cloud Functions][1]. It discusses offloading work from a client app to Cloud Functions using an authentication trigger.

  1. Create a new Firebase project
  2. Enable email/password authentication
  3. Provision Cloud Firestore and apply the rules given in this gist
  4. Use the Firebase CLI to create a workspace for Functions using TypeScript
  5. Deploy the given HTML and JavaScript to Firebase Hosting (the CLI emulator will also work).
  6. Deploy the function code to Cloud Functions using the Firebase CLI
@gausoft
gausoft / Flutter Local_Auth Setting for Android (MainActivity.kt) #kotlin.md
Created August 21, 2020 20:16 — forked from akifarhan/localAuthSettingsForAndroid_kotlin.md
Flutter Local_Auth Setting for Android (MainActivity.kt) #kotlin

Note that local_auth plugin requires the use of a FragmentActivity as opposed to Activity. This can be easily done by switching to use FlutterFragmentActivity as opposed to FlutterActivity in your manifest (or your own Activity class if you are extending the base class).

1. Open android>app>src>main>AndroidManifest.xml

Add USE_FINGERPRINT permission.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.[your.package]">
  <uses-permission android:name="android.permission.USE_BIOMETRIC"/>
  <application...