Skip to content

Instantly share code, notes, and snippets.

View luisgagocasas's full-sized avatar
💙
CEO at AyPhu

Luis Gago Casas luisgagocasas

💙
CEO at AyPhu
View GitHub Profile
@nicosingh
nicosingh / .env
Last active December 17, 2024 01:10
MySQL cluster using docker
MYSQL_ROOT_PASSWORD=rootpass
@luisgagocasas
luisgagocasas / content-advisory.blade.php
Created December 4, 2018 17:13
Bootstrap 4 carousel making dynamic with PHP
<section class="slider-advisory">
<div class="container p-0">
@php
$wp_query = new WP_Query(
array(
'post_type' => 'advisory',
'post_status' => 'publish',
'posts_per_page' => -1
)
);
@anthonycoffey
anthonycoffey / wp_rest_api_endpoint_example.php
Last active November 25, 2024 17:17
WordPress REST API Custom Endpoint Example
<?php
/* 1. add function to rest_api_init hook, */
/* 2. then, call register_rest_route() function */
add_action( 'rest_api_init', 'define_endpoint');
function define_endpoint(){
register_rest_route( 'namespace', '/new/route', array(
'methods' => array('POST','GET','UPDATE','DELETE'),
'callback' => 'my_awesome_func'
) );
}
@submtd
submtd / setup.sh
Last active November 1, 2021 22:07
Ubuntu 18.04 PHP Local Development
#!/bin/bash
sudo add-apt-repository -y ppa:ondrej/php
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt update
sudo apt install -y mysql-server mysql-client nginx redis-server nodejs pkg-config sqlite3 git curl postgresql-client mercurial zip bash-completion xvfb gtk2-engines-pixbuf xfonts-cyrillic xfonts-100dpi xfonts-75dpi xfonts-base xfonts-scalable imagemagick x11-apps \
sudo apt-get install -y \
@bradtraversy
bradtraversy / docker-help.md
Last active April 26, 2025 18:27
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@jeremysells
jeremysells / .env
Last active November 5, 2022 00:56
Jenkins Example
REGISTRY_URI=registry.example.com
APPLICATION_DOCKER_FROM_IMAGE=ubuntu:18.04
APPLICATION_PHP_VERSION=7.2
APPLICATION_CODE=some-thing
APPLICATION_NAME=Some\ Thing
APPLICATION_DESCRIPTION=Some\ Thing\ Else
APPLICATION_VENDOR_NAME=Your\ Name
DATA_DIR=../some-thing-data
# Dev only.
@ansulev
ansulev / nginx-pcache-default.conf
Created July 12, 2018 14:24
Default config for NGINX reverse proxy cache with Apache.
#fix 504 gateway timeouts, can go in nginx.conf
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
#set the location of the cached files, zone, name, size (100 MB) and how long to cache for 600 minutes
proxy_cache_path /var/run/proxy-cache levels=1:2 keys_zone=WORDPRESS:10m max_size=100m
inactive=600m;
proxy_cache_key $scheme$host$request_uri;
@analogic
analogic / docker-compose.yml
Last active June 6, 2024 12:12
Poste.io (with Lets Encrypt) + Nginx reverse proxy + Nginx Lets encrypt companion
version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy
labels:
com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true"
container_name: nginx-proxy
restart: unless-stopped
ports:
@faceonline
faceonline / wp-auto-login-single-user.php
Last active January 15, 2024 05:35 — forked from cliffordp/functions.php
Automatically login a single WordPress user upon arrival to a specific page. Redirect to home page once logged in. Prevent viewing the login page. Tested with WP 3.9.1. Used in functions.php
<?php
//Automatically login a single WordPress user upon arrival to a specific page.
//Redirect to home page once logged in and prevent viewing of the login page.
//Tested with WP 3.9.1. Used in functions.php
//Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
//From http://tourkick.com/2014/wordpress-demo-multisite-db-reset/
function auto_login() {
//change these 2 items
$loginpageid = '1234'; //Page ID of your login page
@Warchant
Warchant / sonarqube-docker-compose.yml
Last active December 7, 2024 03:37
docker-compose file to setup production-ready sonarqube
version: "3"
services:
sonarqube:
image: sonarqube
expose:
- 9000
ports:
- "127.0.0.1:9000:9000"
networks: