Skip to content

Instantly share code, notes, and snippets.

View cristiancorreau's full-sized avatar

Cristian Correa cristiancorreau

View GitHub Profile
@cristiancorreau
cristiancorreau / site.conf
Created December 15, 2022 01:17 — forked from paskal/site.conf
Nginx configuration for best security and modest performance. Full info on https://terrty.net/2014/ssl-tls-in-nginx/
# read more at https://terrty.net/2014/ssl-tls-in-nginx/
# latest version on https://gist.github.com/paskal/628882bee1948ef126dd/126e4d1daeb5244aacbbd847c5247c2e293f6adf
# security test score: https://www.ssllabs.com/ssltest/analyze.html?d=terrty.net
# your nginx version might not have all directives included, test this configuration before using in production against your nginx:
# $ nginx -c /etc/nginx/nginx.conf -t
server {
# public key, contains your public key and class 1 certificate, to create:
# (example for startssl)
# $ (cat example.com.pem & wget -O - https://www.startssl.com/certs/class1/sha2/pem/sub.class1.server.sha2.ca.pem) | tee -a /etc/nginx/ssl/domain.pem > /dev/null
@cristiancorreau
cristiancorreau / gist:afec3bad8bb165ef0efe897ea0d13cd2
Created September 22, 2021 13:01
.zshrc Android Studio MAC
export ANDROID_SDK_ROOT=/Users/{USER}/Library/Android/sdk
export ANDROID_HOME=/Users/{USER}/Library/Android/sdk
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/Contents/Home"
@cristiancorreau
cristiancorreau / gist:77cfef9409383096a548ad308ad24e81
Created September 22, 2021 12:22
fix flutter doctor not detecting android studio plugins on mac
#ln -s ~/Library/Application Support/Google/AndroidStudio[VERSION]/plugins ~/Library/Application\ Support/AndroidStudio[VERSION]
#Example for AndroidStudio2020.3
ln -s ~/Library/Application Support/Google/AndroidStudio2020.3/plugins ~/Library/Application\ Support/AndroidStudio2020.3
@cristiancorreau
cristiancorreau / wpfix.sh
Created January 5, 2021 15:39
Fix wordpress file permissions CentOS
#!/bin/bash
#
WP_OWNER=apache # <-- wordpress owner
WP_GROUP=apache # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
WS_GROUP=apache # <-- webserver group
# reset to safe defaults
find ${WP_ROOT} -exec chown ${WP_OWNER}:${WP_GROUP} {} \;
find ${WP_ROOT} -type d -exec chmod 755 {} \;
@cristiancorreau
cristiancorreau / update_domain_wp.sql
Last active July 17, 2017 00:23
Update links site Wordpress change domain
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
@cristiancorreau
cristiancorreau / Translate Buttons Divi
Last active June 12, 2017 02:17
Wordpress Divi Theme : Traducir Divi botón Read More
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("button.et_pb_contact_submit.et_pb_button").text("Enviar");
jQuery("a.et_pb_more_button.et_pb_button").text("Seguir leyendo");
jQuery("input#submit.submit.et_pb_button").val("Enviar comentario");
});
</script>
@cristiancorreau
cristiancorreau / .js
Created June 12, 2017 01:48
Wordpress Divi Theme : Traducir Divi botón Read More
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("button.et_pb_contact_submit.et_pb_button").text('Enviar');
});
</script>
@cristiancorreau
cristiancorreau / remove-gf-divi.php
Created June 6, 2017 23:03 — forked from mkrdip/remove-gf-divi.php
Remove Google Fonts from Divi
<?php
function wpse_dequeue_google_fonts() {
wp_dequeue_style( 'divi-fonts' );
}
add_action( 'wp_enqueue_scripts', 'wpse_dequeue_google_fonts', 20 );
@cristiancorreau
cristiancorreau / gist:f9e827b977caebb187ca
Last active August 29, 2015 14:23
MainActivity.java - P10I11_U3_Ksoap
package cl.inacap.ksoapejemplo;
import java.util.concurrent.ExecutionException;
import cl.inacap.clases.WSBackgroundConnection;
import com.example.ksoapejemplo.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import java.text.DecimalFormat;
// Declaración de un ArrayList de "String". Puede ser de cualquier otro Elemento u Objeto (float, Boolean, Object, ...)
ArrayList<String> gatitosArrayList = new ArrayList<String>();
// Añade el elemento(un gatito) al ArrayList
gatitosArrayList.add("Benito");
// Añade el elemento al ArrayList en la posición 'n'
gatitosArrayList.add(n, "Don Gato");