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
@luisgagocasas
luisgagocasas / Responsive CSS Image Slider - Jade, Stylus
Last active August 29, 2015 14:23
Responsive CSS Image Slider - Jade, Stylus
Responsive CSS Image Slider - Jade, Stylus
------------------------------------------
Preprocessor: Jade Stylus
https://luisgagocasas.com/
A [Pen](http://codepen.io/luisgagocasas/pen/eNyvoz)
@luisgagocasas
luisgagocasas / Para que funcione extends en jadephp Grunt
Last active August 29, 2015 14:25
Para que funcione extends en jadephp Grunt
Para que funcione con extends tiene que usar esta configuración en su archivo Gruntfile.js
//base.jade
<!DOCTYPE html>
html(lang="es")
head
meta(charset="UTF-8")
block titulo
title Luis Gago Casas
body
@luisgagocasas
luisgagocasas / install-ispconfig3-ubuntu.sh
Last active October 4, 2015 04:07
Install ISPConfig3 Ubuntu 14.04 64Bits
#!/bin/bash
## Install ISPConfig3 on Ubuntu 14.04 64Bits
## Author Original: Nilton OS blog.linuxpro.com.br
## Modificado Español: Luis Gago Casas luisgagocasas.com
## Version 0.6
## Caso precise
## echo 'LC_ALL="en_US.utf8"' >>/etc/environment
## dpkg-reconfigure dash
@luisgagocasas
luisgagocasas / Leer-API-REST-con-PHP.php
Last active February 11, 2016 19:46
Leer una API REST de wordpress desde PHP
<?php
//PRIMERA OPCION - funciones nativas php
//Optengo la API REST
$url = "http://localhost/wordpress/?page_id=2&json=1";
$data = file_get_contents($url);
$json = json_decode($data);
//Muestro los resultados
echo "<p>".$json->status."</p>";
echo "<p>".$json->page->id."</p>";
var items = "";
$.getJSON( "http://localhost/wordpress/?page_id=246&json=1", function(data) {
for (var i = 0; i < data.page.comments.length; i++) {
items += '<p>'+data.page.comments[i].name+'</p>>';
}
$("#lista_comentarios").html(items);
})
@luisgagocasas
luisgagocasas / home.blade.php
Last active November 12, 2018 01:45
how to detect with elementor if I am on the site or in the administrator - root sage - Elementor pro
<!doctype html>
<html @php(language_attributes())>
@include('partials.head')
<body @php(body_class())>
@php(do_action('get_header'))
@if (elementor_location_exits( 'header_content', true ))
@include('partials.header')
@else
@include('partials.header-home')
@endif
@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
)
);
@luisgagocasas
luisgagocasas / setup.sh
Created May 10, 2019 09:49 — forked from submtd/setup.sh
Ubuntu 18.04 PHP Local Development
#!/bin/bash
# This script will set up a LEMP environment for local development on
# Ubuntu 18.04. Nginx will look for sites in ~/Code/{folder}/public/. These
# sites can be accessed locally by going to http://{folder}.localtest.me. An
# example site called "info" is created automatically and you can view it by
# going to http://info.localtest.me. The source code for this site is in
# ~/Code/info/public/
# ADD SOME PPAs
@luisgagocasas
luisgagocasas / docker-compose.yml
Last active March 1, 2020 19:16
docker nginx proxy: multi sites
version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy
restart: always
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
@luisgagocasas
luisgagocasas / .bashrc
Created December 28, 2021 16:41 — forked from stuart-warren/.bashrc
search google from terminal
# get back a list of urls for search term
# $ goog stuart-warren github
# $ goog site:stackoverflow.com ValueError
goog() {
# uses https://github.com/mgdm/htmlq
query=${@}
v=""
if [[ "$1" == "-v" ]]; then v="-v"; fi
curl ${v} -LG --data-urlencode "q=${query}" \
--data-urlencode "sourceid=chrome" \