Skip to content

Instantly share code, notes, and snippets.

<?php
/** Code for custom loop */
function my_custom_loop() {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
// WP_Query arguments
$args = array (
'post_type' => 'any',
'category_name' => 'hall-dos-aprovados',
'pagination' => true,
'paged' => $paged,
Cutting Through Spiritual Materialism by Chogyam Trungpa
The wrong way to take refuge involves seeking shelter—worshiping mountains, sun gods, moon gods, deities of any kind simply because they would seem to be greater than we. This kind of refuge-taking is similar to the response of the little child who says, “If you beat me, I’ll tell my mommy,” thinking that his mother is a great, archetypically powerful person. If he is attacked, his automatic recourse is to his mother, an invincible and all-knowing, all-powerful personality. The child believes his mother can protect him, in fact that she is the only person who can save him. Taking refuge in a mother- or father-principle is truly self-defeating; the refuge-seeker has no real basic strength at all, no true inspiration. He is constantly busy assessing greater and smaller powers. If we are small, then someone greater can crush us. We seek refuge because we cannot afford to be small and without protection. We tend to be apologetic: “I am such a small thing,
@rslonik
rslonik / link Aprova
Created June 15, 2015 12:37
Link Aprova
<?php
#
# INSERIR AD DEPOIS DO QUINTO PARAGRAFO (SE HOUVER)
#
function nm_ad_content($content)
{
if ( has_tag('noads') || !is_single() )
{
return $content;
}
@rslonik
rslonik / VideoStories-HomeVideoScript.yml
Last active March 22, 2017 18:19
VideoStories - Home Video
# Video Name - without spaces
name: "HomeVideoStories"
# Square image 40x40
watermark: "https://videostories.co/wp-content/uploads/2017/03/videostories-40-allwhite.png"
# Any size up to 500x500
logo: "https://videostories.co/wp-content/uploads/2017/03/videostories-allwhite.png"
# Used in the ending background
@rslonik
rslonik / ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY.md
Last active September 11, 2019 21:26
ERR_SPDY_INADEQUATE_TRANSPORT_SECURITY
/var/www/site.com/conf/nginx/ssl.conf
https://gist.github.com/kiki67100/f5b421ddac9d500297b0e6471e5ef737

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
@rslonik
rslonik / products_with_category.sql
Created August 27, 2019 20:37
QUERY Woo Products With Price, Name, Category
SELECT
wp_posts.post_title AS Product,
wp_postmeta1.meta_value AS SKU,
wp_postmeta2.meta_value AS Price,
GROUP_CONCAT( wp_terms.name ORDER BY wp_terms.name SEPARATOR ', ' ) AS ProductCategories
FROM wp_posts
LEFT JOIN wp_postmeta wp_postmeta1
ON wp_postmeta1.post_id = wp_posts.ID
AND wp_postmeta1.meta_key = '_sku'
LEFT JOIN wp_postmeta wp_postmeta2
@rslonik
rslonik / nginx-geoip.md
Created August 27, 2019 20:37
NGINX GEOIP HEADER

nginx -V Precisa ter o módulo --with-http_geoip_module instalado.

mkdir /etc/nginx/geoip cd /etc/nginx/geoip

Baixar a base GeoIP em CSV e converter pra DAT https://dev.maxmind.com/geoip/geoip2/geolite2/ wget https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country-CSV.zip

@rslonik
rslonik / easyengine-update-php.md
Created August 27, 2019 20:38
Atualizar PHP no easyengine

How to install php7.2-fpm with EasyEngine (Ubuntu)


Add php7.2 repository

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Install php7.2-fpm

@rslonik
rslonik / gist:6e28f5403834a78364081a9501c8a1b1
Created August 27, 2019 23:33
sshd fails to start because missing /var/run/sshd dir (ubuntu)
vim /usr/lib/tmpfiles.d/sshd.conf
# remove the "/var"
d /run/sshd 0755 root root
systemd-tmpfiles --create
now the dir will be created at boot and ssh will show up
-------
https://serverfault.com/questions/941855/why-am-i-missing-var-run-sshd-after-every-boot
-------