Skip to content

Instantly share code, notes, and snippets.

View dsebao's full-sized avatar
🏠
Working from home

Sebastian Ortiz dsebao

🏠
Working from home
View GitHub Profile
<!-- Favicons -->
<link rel="apple-touch-icon" href="" sizes="180x180">
<link rel="icon" href="" sizes="32x32" type="image/png">
<link rel="icon" href="" sizes="16x16" type="image/png">
<link rel="icon" href="">
<meta name="theme-color" content="#333333">
@dsebao
dsebao / single.php
Last active September 17, 2018 17:59
<h5>Seguí leyendo</h5>
<?php
$related = get_posts( array( 'category__in' => wp_get_post_categories($post->ID), 'numberposts' => 3, 'post__not_in' => array($post->ID) ) );
if( $related ) foreach( $related as $post ) {
setup_postdata($post);?>
<article>
<div class="row">
<div class="col-3">
<?php if(my_image($post->ID, 'thumbnail')){?>
@dsebao
dsebao / GoogleSpreadsheet.html
Created August 24, 2018 14:28 — forked from terrywbrady/GoogleSpreadsheet.html
Sample HTML/JS to parse a Google Spreadsheet
<!doctype html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var spData = null;
function doData(json) {
spData = json.feed.entry;
}
@dsebao
dsebao / script.js
Last active September 5, 2018 17:41
[Publicar en google spreadsheet]
// Usage
// 1. Enter sheet name where data is to be written below
// 1. Enter sheet name and key where data is to be written below
var SHEET_NAME = "Hoja";
var SHEET_KEY = "SHEETKEY";
// 2. Run &gt; setup
//
// 3. Publish &gt; Deploy as web app
// - enter Project Version name and click 'Save New Version'
#1: CODE
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]
#(last line means visitor is redirected to index with Forbidden message ([F))
@dsebao
dsebao / .htaccess
Last active May 2, 2018 14:08 — forked from Zodiac1978/.htaccess
Safer WordPress with these .htaccess additions
# Don't show errors which contain full path diclosure (FPD)
# Use that line only if PHP is installed as a module and not per CGI
# try using a php.ini in that case.
# Change mod_php5.c to mod_php7.c if you are running PHP7
<IfModule mod_php5.c>
php_flag display_errors Off
</IfModule>
# Don't list directories
<IfModule mod_autoindex.c>
//Flexible ajax using promises
function getName(personid) {
var dynamicData = {};
dynamicData["id"] = personID;
return $.ajax({
url: "getName.php",
type: "get",
data: dynamicData
});
}
<title></title>
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="author" content="infinito!">
/*Open graph*/
<meta property="og:title" content="" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://dominio.com" />
define ('WP_CONTENT_FOLDERNAME', 'myfolder' );
define ('WP_CONTENT_DIR', ABSPATH . WP_CONTENT_FOLDERNAME );
define ('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/' );
define ('WP_CONTENT_URL', WP_SITEURL . WP_CONTENT_FOLDERNAME );
function action_wp_mail_failed($wp_error)
{
return error_log(print_r($wp_error, true));
}
// add the action
add_action('wp_mail_failed', 'action_wp_mail_failed', 10, 1);