Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Gustavo Reyes gusreyes01

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
@gusreyes01
gusreyes01 / comandos-github.md
Created May 11, 2019
Comandos básicos Github
View comandos-github.md
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
gusreyes01 / bobp-python.md
Created Aug 29, 2018 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.
View bobp-python.md

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

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

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
View call_procedure.py
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,j.pathname+j.search)))}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(Array.prototype.slice.call(arguments,
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
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, 'http://en.zourcing.com', 'http://zourcing.com') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://en.zourcing.com', 'http://zourcing.com');
UPDATE wp_posts SET post_content = replace(post_content, 'http://en.zourcing.com', 'http://zourcing.com');
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://en.zourcing.com', 'http://zourcing.com');
UPDATE wp_options SET option_value = replace(option_value, 'http://en.zourcing.com', 'http://zourcing.com') WHERE option_name = 'home' OR option_name = 'siteurl';
View mario.html
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser-polyfill.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="https://rawgit.com/kimmobrunfeldt/progressbar.js/1.0.0/dist/progressbar.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/1.7.3/socket.io.min.js"></script>
<script>
var socket = io('http://localhost:8282');
socket.on('change', function (data) {
You can’t perform that action at this time.