Skip to content

Instantly share code, notes, and snippets.

View abr4xas's full-sized avatar
🐧
Focusing

ángel abr4xas

🐧
Focusing
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',
@nielspeen
nielspeen / ConversionService.php
Created August 13, 2023 10:23
Measure conversions using Laravel Pennant
<?php
namespace App\Services;
/*
* A thin layer on top of Laravel Pennant to track conversions.
*/
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
@pagelab
pagelab / wp_remote_get_with_cache.php
Created October 19, 2021 00:50 — forked from msaari/wp_remote_get_with_cache.php
wp_remote_get_with_cache – Fetches remote data with dual-layer caching
<?php
/**
* Fetches remote data with dual-layer caching.
*
* Uses wp_remote_get to fetch remote data. The data is cached twice: it's
* stored in a transient and an option. The transient is used as the main cache
* but if the transient has expired and the remote site doesn't respond,
* backup data from the option is returned.
*
@owenconti
owenconti / 5ec339ed59c37.html
Created May 19, 2020 01:44
Moving our search drop down from Algolia to Alpine.js
<div class="relative">
<div id="#search-box"></div>
<div id="#hits"></div>
</div>
@Villanuevand
Villanuevand / README-español.md
Last active May 3, 2024 10:38
Una plantilla para hacer un buen README.md. Inspirado en el gist de @PurpleBooth => https://gist.github.com/PurpleBooth/109311bb0361f32d87a2

Título del Proyecto

Acá va un párrafo que describa lo que es el proyecto

Comenzando 🚀

Estas instrucciones te permitirán obtener una copia del proyecto en funcionamiento en tu máquina local para propósitos de desarrollo y pruebas.

Mira Deployment para conocer como desplegar el proyecto.

@m2sh
m2sh / DOSpacesStorageServiceProvider.php
Last active January 17, 2024 05:03
How To Use Digitalocean Spaces as Laravel Cloud filesystems
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Aws\S3\S3Client;
use League\Flysystem\AwsS3v3\AwsS3Adapter;
use League\Flysystem\Filesystem;
use Storage;
@campoy
campoy / settings.json
Created July 24, 2017 21:11
My vscode settings
{
"window.zoomLevel": 0,
"go.lintOnSave": "package",
"editor.fontFamily": "'Fira Code', Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": false,
"workbench.iconTheme": "vs-seti",
"go.addTags": {
"tags": "json",
"options": "json=omitempty",
"promptForTags": true,
@maheshwaghmare
maheshwaghmare / create-post-by-using-wp_remote_post.php
Last active April 4, 2021 06:23
Create post using wp_remote_post() function in WordPress. Required plugin https://github.com/WP-API/Basic-Auth
<?php
/**
* NOTE: Required plugin https://github.com/WP-API/Basic-Auth to install and activate on the same site.
* It works on same site.
*/
// API Details.
$rest_url = 'http://{MY_SITE}/wp-json/wp/v2/posts';
$username = 'my-username';
@ahmadawais
ahmadawais / upload-a-file.MD
Created June 18, 2017 11:07 — forked from websupporter/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@simonhamp
simonhamp / AppServiceProvider.php
Last active May 4, 2024 04:21
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()