Skip to content

Instantly share code, notes, and snippets.

View LuisRBarreras's full-sized avatar

Luis R Barreras LuisRBarreras

View GitHub Profile
npm init
npm react react-dom react-router --save
npm install react react-dom react-router --save
npm install webpack webpack-dev-server babel-core babel-loader babel-preset-es2015 bael-preset-react --save-dev
npm install webpack webpack-dev-server babel-core babel-loader babel-preset-es2015 babel-preset-react --save-dev
touch .babelrc webpack.config.js
Ejercicio
Realizar un application con Django para buzon de sugerencias.
1.Debe tener una seccion de commentarios donde puedes enviar
comentarios y todos los comentario registrados.
Cada comentario debe tener:
# email
# contenido o mensage
# Fecha de registo
# Fecha en que el comentario fue enviado(Checar punto 2)
<?php
//Using the PHP language, have the function tripleDouble(num1,num2) take both parameters being passed,
//and return 1 if there is a straight triple of a number at any place in num1 and also a straight double of the same number
//in num2. For example: if num1 equals 451999277 and num2 equals 41177722899,
//then return 1 because in the first parameter you have the straight triple 999 and you have a straight double,
//99, of the same number in the second parameter. If this isn't the case, return 0.
class TripleDouble
{
const _TRIPLE = 3;
const _DOUBLE = 2;
def quicksort(lst):
if len(lst) == 0:
return lst
pivot = lst[0]
pivots = [x for x in lst if x == pivot]
small = quicksort([x for x in lst if x<pivot])
bigger = quicksort([x for x in lst if x>pivot])
return small + pivots + bigger
from functools import reduce
import sys
def check_credict_card(card_numbers):
singles = reduce(lambda x,y: x+y, [x for x in card_numbers[1::2]])
doubles = reduce(lambda x,y: x+y, [x*2 for x in card_numbers[::2]])
total = singles + doubles
return 'Real' if total % 10 == 0 else 'Fake'
import sys
def permutations(set_char, list_perm=None, path=None):
path = '' if path is None else path
list_perm = [] if list_perm is None else list_perm
if len(set_char) < 2:
return path+set_char[0]
@LuisRBarreras
LuisRBarreras / beautiful_idiomatic_python.md
Created November 10, 2015 16:19 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
def quicksort(lst):
if len(lst) == 0:
return lst
pivot = lst[0]
pivots = [x for x in lst if x == pivot]
smaller = quicksort([x for x in lst if x< pivot])
bigger = quicksort([x for x in lst if x> pivot])
return smaller + pivots + bigger
sudo chown -R $USER /usr/local/lib/node_modules
Where to Start
--------------------------------------------
Friedman, The Little Schemer
K&R, The C Programming Languaage
Graham, ANSI Common Lisp
SICP
Bloch, Effective Java
Sedgewick, Algorithms