Skip to content

Instantly share code, notes, and snippets.

View babacarcissedia's full-sized avatar

Babacar Cissé Dia babacarcissedia

View GitHub Profile
@babacarcissedia
babacarcissedia / google-recaptcha.md
Last active February 9, 2024 01:41
Add google recaptcha to website

Opinionated code Laravel code for adding recaptcha on website. Bot protection especially on open form (without user authentication)

  1. Create blade component for ease of reuse
resources/views/components/input/captcha.blade.php

@props([
    'id',
    'name',
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@babacarcissedia
babacarcissedia / delivery-data-per-address.md
Created September 6, 2021 18:46
delivery data per address
Price Address Distance (km) Duration (minute)
1000 point E 2.1 7
1000 fann 2.1 5
1000 sacré coeur 2.3 9
1000 amitié 1.8 5
1000 castor 4.8 17
1000 dieuppeul 5.2 15
1000 HLM 4.1 12
### Keybase proof
I hereby claim:
* I am babacarcissedia on github.
* I am babacarcissedia (https://keybase.io/babacarcissedia) on keybase.
* I have a public key ASAjXdNTDDj4xIFr1hCRc00BxKg0zj-za1Vp-9V3oKyjfAo
To claim this, I am signing this object:
@babacarcissedia
babacarcissedia / building-api-with-laravel.md
Last active April 30, 2021 11:23
TDD: My process when building API with laravel

Steps

  • Add this to the composer.json script section
        "lint": "vendor/bin/phpcs --ignore=database/migrations/** && composer lint2",
        "lint:fix": "vendor/bin/phpcbf && composer lint2:fix",
        "lint2": "vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --dry-run --using-cache=no",
        "lint2:fix": "vendor/bin/php-cs-fixer fix --config=.php_cs.dist -v --using-cache=no",
        "test": "vendor/bin/phpunit --configuration phpunit.xml",
        "test:feature": "vendor/bin/phpunit --configuration phpunit.xml --testsuite Feature --no-coverage",
        "test:unit": "vendor/bin/phpunit --configuration phpunit.xml --no-coverage --testsuite Unit",
@babacarcissedia
babacarcissedia / chunkItems.js
Created February 25, 2021 14:41
Responsive table - Filling the viewport
import chunk from "lodash/chunk"
// "items" is the generic term used
// to refer to your database items
const chunkedItems = (items, size) => {
return chunk(items, size)
}
const getChunkFor = (width) => {
if (size < 480) {