Skip to content

Instantly share code, notes, and snippets.

Working from home

Gustavo Reyes gusreyes01

Working from home
Block or report user

Report or block gusreyes01

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
from builtins import Exception
import base64
from django.http import HttpResponse
from functools import wraps
from app.logger import EmployeeLogger
def http_basic_auth(func):
gusreyes01 /
Created May 11, 2019
Comandos básicos Github
View valida-curp.js
//Función para validar una CURP
function curpValida(curp) {
var re = /^([A-Z][AEIOUX][A-Z]{2}\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])[HM](?:AS|B[CS]|C[CLMSH]|D[FG]|G[TR]|HG|JC|M[CNS]|N[ETL]|OC|PL|Q[TR]|S[PLR]|T[CSL]|VZ|YN|ZS)[B-DF-HJ-NP-TV-Z]{3}[A-Z\d])(\d)$/,
validado = curp.match(re);
if (!validado) //Coincide con el formato general?
return false;
//Validar que coincida el dígito verificador
function digitoVerificador(curp17) {
View truncate_tables_mysql.sql
# This script will truncate all tables from the command line
# Don't forget to turn foreign keys back on when you're done
mysql -u root --password=PASSWORD -Nse 'show tables' DATABASE | while read table; do mysql -u root --password=PASSWORD -e "SET FOREIGN_KEY_CHECKS=0;truncate table $table" DATABASE;done
gusreyes01 /
Created Aug 29, 2018 — forked from sloria/
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General


  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
from myproject import settings
dbHost = settings.DATABASES['default']['HOST']
dbUsername = settings.DATABASES['default']['USER']
dbPassword = settings.DATABASES['default']['PASSWORD']
dbName = settings.DATABASES['default']['NAME']
def call_pgsl_function(function_name, arg):
conn = psycopg2.connect(
"dbname={} user={} password={} host={}”.format(dbName, dbUsername, dbPassowrd, dbHost)
View zourcing-mixpanel.js
<!-- start Mixpanel --><script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(,
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.u
gusreyes01 / wordpress-update.txt
Last active Oct 30, 2018
Change wordpress url snippet
View wordpress-update.txt
UPDATE wp_options SET option_value = replace(option_value, '', '') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, '', '');
UPDATE wp_posts SET post_content = replace(post_content, '', '');
UPDATE wp_postmeta SET meta_value = replace(meta_value, '', '');
UPDATE wp_options SET option_value = replace(option_value, '', '') WHERE option_name = 'home' OR option_name = 'siteurl';
View mario.html
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
var socket = io('http://localhost:8282');
socket.on('change', function (data) {
You can’t perform that action at this time.