Skip to content

Instantly share code, notes, and snippets.

View CarMoreno's full-sized avatar
🐍
Coding...

Carlos Moreno CarMoreno

🐍
Coding...
View GitHub Profile
@CarMoreno
CarMoreno / fusion.sql
Last active November 19, 2020 15:44
Unir tablas PIVOT eliminando duplicados - Bigquery
CREATE OR REPLACE TABLE `tabla_c` AS
(
WITH tabla_intermedia AS (
SELECT * FROM `tabla_a` #Tabla Inicial
UNION DISTINCT
SELECT * FROM `tabla_2` #Tabla particionada 2
)
SELECT row[OFFSET(0)].* FROM (
SELECT ARRAY_AGG(t ORDER BY fecha_consulta DESC LIMIT 1) row
class PalancaCambio:
# Suponemos que el carro arranca en Neutro (cambio 0 para nosotros)
cambio_actual = 0
def __init__(self, numero_cambios = 4, color='Negro', peso='50gr'):
self.numero_cambios = numero_cambios
self.color = color
self.peso = peso
@CarMoreno
CarMoreno / setup.py
Created December 2, 2015 00:40
Archivos ejecutables en Python 3.x con cx_Freeze.
import sys
from cx_Freeze import setup, Executable
# base por defecto está para trabajar con apps de consola, en nuestro caso queremos una app gráfica
# si la plataforma es windows, entonces seteamos base a Win32GUI
if sys.platform == "win32":
base = "Win32GUI"
ejecutables = [Executable(
"main.pyw", #El archivo desde donde corre tu aplicacion
@CarMoreno
CarMoreno / regex.txt
Created November 9, 2015 02:45 — forked from nerdsrescueme/regex.txt
Common Regex
Perl and PHP Regular Expressions
PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and will include delimiters.
All Major Credit Cards
This regular expression will validate all major credit cards: American Express (Amex), Discover, Mastercard, and Visa.
//All major credit cards regex
'/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|622((12[6-9]|1[3-9][0-9])|([2-8][0-9][0-9])|(9(([0-1][0-9])|(2[0-5]))))[0-9]{10}|64[4-9][0-9]{13}|65[0-9]{14}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})*$/'
@CarMoreno
CarMoreno / Simple and Responsive Template..markdown
Last active September 27, 2015 17:02
Simple and Responsive Template

Simple and Responsive Template.

Responsive and generic template...the goal is strengthen basic concepts about responsive design. :)

A Pen by Carlos Moreno on CodePen.

License.