Skip to content

Instantly share code, notes, and snippets.

View alexander-ae's full-sized avatar

Alexander alexander-ae

View GitHub Profile
@alexander-ae
alexander-ae / install-comodo-ssl-cert-for-nginx.rst
Created October 12, 2015 22:59 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@alexander-ae
alexander-ae / httpd.conf
Last active February 1, 2016 19:47
nginx/apache redirect www and ssl
Nginx no-www to www
-------------------
server {
#listen 80 is default
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
server {
#listen 80 is default
$("#{{ inline_admin_formset.formset.prefix }}-group").grp_inline({
prefix: "{{ inline_admin_formset.formset.prefix }}",
//////////Función agregada para precargar y ejecutar el complemento tinyMCE
onBeforeAdded:function(form) {
if (tinyMCE != undefined) {
django.jQuery('.grp-empty-form').find('textarea').each(function() {
var tid = django.jQuery(this).attr("id");
tinyMCE.execCommand("mceRemoveControl",false,tid);
});
@alexander-ae
alexander-ae / sql
Created April 16, 2015 16:21
wordpress - replace url
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');
@alexander-ae
alexander-ae / .htaccess
Last active August 29, 2015 14:18
www to non www
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# non www to www and https
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
@alexander-ae
alexander-ae / comments.tag
Last active August 29, 2015 14:15
riot + parse
<comment-box>
<h1>{ opts.title }</h1>
<comment-list comments={ comments } />
<comment-form />
this.comments = []
add(comment) {
this.comments.push(comment)
@alexander-ae
alexander-ae / web.conf
Created February 5, 2015 15:08
nginx: django + wordpress
server {
listen 80;
# server_name base.pe;
server_tokens off;
root /home/devstaff/webapps/;
location /blog {
index index.php index.html index.htm;
@alexander-ae
alexander-ae / wsgi.py
Created January 6, 2015 19:41
wsgi.py (windows)
import os
import sys
from os.path import dirname, realpath
# directorio del proyecto
SITE_ROOT = dirname(realpath(__file__))
# entorno
sys.path = [SITE_ROOT, 'C:\Python27\Lib\site-packages'] + sys.path
@alexander-ae
alexander-ae / check_parents.py
Last active August 29, 2015 14:09
Plugin para verificar la ruta de un selector css
import sublime
import sublime_plugin
import re
import os
class CheckParentCommand(sublime_plugin.TextCommand):
def run(self, edit):
# inicializa
@alexander-ae
alexander-ae / httpd.conf
Created November 5, 2014 15:23
Configuración de apache para python
Alias /static_hv "C:/proys/static_proyecto/"
<Directory "C:/proys/static_proyecto">
AllowOverride AuthConfig
Require all granted
</Directory>
WSGIScriptAlias / "C:\proys/staff-proyecto/src/settings/wsgi.py"
WSGIPythonPath "C:/proys/staff-proyecto/src"