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',
@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 April 18, 2024 17:55
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:

@davidtrushkov
davidtrushkov / gist:a8bdb87227db23b147ddc22136ebc330
Created December 21, 2016 22:32
Make Bootstrap Carousel Dynamic - Laravel 5.3
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
@foreach( $trip->photos as $photo )
<li data-target="#carousel-example-generic" data-slide-to="{{ $loop->index }}" class="{{ $loop->first ? 'active' : '' }}"></li>
@endforeach
</ol>
<!-- Wrapper for slides -->
@wpscholar
wpscholar / rss-to-json.php
Last active January 29, 2021 01:41
A simple must-use plugin for WordPress that will provide a `/feed/json` endpoint for converting RSS feeds to JSON.
<?php
/**
* A simple must-use plugin for WordPress that will provide a `/feed/json` endpoint for converting RSS feeds to JSON.
* In the absence of any URL parameters, it will convert the main feed to JSON. If a URL is set, it will convert the
* feed from that URL into JSON. If a callback is set, a JSONP implementation will be returned.
*
* Note: Be sure to flush rewrite rules manually by visiting the 'General'->'Permalinks' page in the WordPress admin. If
* you are using this in a plugin, be sure to flush the rewrite rules on activation using the 'flush_rewrite_rules()' function.
*