Skip to content

Instantly share code, notes, and snippets.

Avatar
🏴

Elvis Morales elvismdev

🏴
View GitHub Profile
View telegram.yaml
parameters:
telegram.token: '%env(TELEGRAM_TOKEN)%'
telegram.webhook_secret: '%env(TELEGRAM_WEBHOOK_SECRET)%'
services:
GuzzleHttp\Client:
arguments:
- { timeout: 120}
Http\Factory\Guzzle\RequestFactory:
@sophiawzey
sophiawzey / count.php
Last active Jun 2, 2020
[ACF PHP] using brackets #acf
View count.php
<?php $count = count( get_field( 'field-name' ) ); ?> // can be used for counting rows in a repeater. works well w/ slick slider if you only want a slider on > 2 counts
@whoisryosuke
whoisryosuke / api-form-submit.js
Created Oct 3, 2018
React - Handling forms and submitting POST data to API -- @see: https://reactjs.org/docs/forms.html
View api-form-submit.js
class NameForm extends React.Component {
constructor(props) {
super(props);
this.state = { name: '' };
}
handleChange = (event) => {
this.setState({[event.target.name]: event.target.value});
}
@Garconis
Garconis / acf-states.txt
Created Aug 10, 2018 — forked from michaeldozark/acf-states.txt
State list for Advanced Custom Fields select field
View acf-states.txt
AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
CT : Connecticut
DE : Delaware
DC : District of Columbia
FL : Florida
@giansalex
giansalex / docker-php-ext-install.md
Last active Sep 12, 2020
docker-php-ext-install Reference
View docker-php-ext-install.md
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ 
@mgibbs189
mgibbs189 / test.js
Last active Jul 30, 2020
FacetWP - modify flatpickr options
View test.js
<script>
(function($) {
FWP.hooks.addFilter('facetwp/set_options/date_range', function(flatpickr_opts, extras) {
flatpickr_opts['allowInput'] = true;
return flatpickr_opts;
});
})(jQuery);
</script>
@amboutwe
amboutwe / yoast_seo_primary_category_disable.php
Last active Apr 17, 2020
Disable Yoast SEO Primary Category Feature
View yoast_seo_primary_category_disable.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Disable Yoast SEO Primary Category Feature
* Credit: Yoast development team
* Last Tested: Jan 24 2017 using Yoast SEO 4.1 on WordPress 4.7.1
*/
add_filter( 'wpseo_primary_term_taxonomies', '__return_empty_array' );
@aimeric
aimeric / DefaultController.php
Created Jan 23, 2017
Symfony Ajax live search (autocomplete)
View DefaultController.php
<?php
/* src/AppBundle/Controller/DefaultController */
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\DependencyInjection\ContainerInterface;
View js_calculate_progress_percentage.js
var completed = 30;
var target = 30;
var progress = Math.ceil(completed / target * 100);
console.log(progress);
@msmfsd
msmfsd / es7-async-await.js
Last active Aug 28, 2020
Javascript fetch JSON with ES7 Async Await
View es7-async-await.js
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
You can’t perform that action at this time.