Skip to content

Instantly share code, notes, and snippets.

View felipecabargas's full-sized avatar
🇩🇰
Imported from 🇨🇱

A. Felipe Cabargas felipecabargas

🇩🇰
Imported from 🇨🇱
View GitHub Profile
@felipecabargas
felipecabargas / custom-navbar.css
Created January 26, 2012 13:27
jquery-mobile custom navbar theme
.ui-footer.ui-bar-footer {
-webkit-box-shadow: 0 1px 0 rgba(39,39,39,0.5) inset, 0 -1px 0 rgba(0,0,0,0) inset;
-moz-box-shadow: 0 1px 0 rgba(39,39,39,0.5) inset, 0 -1px 0 rgba(0,0,0,0) inset;
box-shadow: 0 1px 0 rgba(39,39,39,0.5) inset, 0 -1px 0 rgba(0,0,0,0) inset;
border: 0 none;
background-image: -webkit-gradient(
linear,
left top,
left bottom,
color-stop(0, #343434),
@felipecabargas
felipecabargas / grayscaletransition.css
Last active December 15, 2015 06:19
grayScale + opacity CSS Transition
.class{
opacity: 0.8;
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */
/*CSS Transition*/
-webkit-transition: all 0,2s ;
-moz-transition: all 0,2s ;
-ms-transition: all 0,2s ;
-o-transition: all 0,2s ;
@felipecabargas
felipecabargas / prograpepa.py
Last active December 15, 2015 06:29
Ejercicio Programación FCFM (Pepa)
h = input("Cuantos hombres hay?: ")
m = input("Cuantas mujeres hay?: ")
p = 100 * h / (h + m)
print "El porcentaje de hombres es:",p
print "El porcentaje de mujeres es:", (100 - p)
@felipecabargas
felipecabargas / problema2.py
Created March 25, 2013 23:02
Respuestas problemas 2 y 3 - Primera Actividad en Clases curso de Programación (IWI-131) UTFSM Stgo.
minutos = float(raw_input("Minutos hablados: "))
horario = raw_input("Horario: ")
if horario=="NOCHE":
subtotal = int(minutos*7)
else:
subtotal = int(minutos*10)
if subtotal > 1500:
descuento = int(subtotal/10)
@felipecabargas
felipecabargas / palindromos.py
Last active July 23, 2016 18:53
Verificador de Palíndromos
#!/usr/bin/python
#Developed by A. Felipe Cabargas <felipe@cabargas.com>
#All rights reserved 2013 - http://github.com/felipecabargas
def invertir_digitos(n):
return int(str(n)[::-1])
n = int(raw_input("Ingrese n: "))
p = invertir_digitos(n)
@felipecabargas
felipecabargas / concreto.py
Created March 29, 2013 00:26
Cubo de Concreto
import turtle as t
from math import sqrt
t.forward(10)
t.right(90)
t.forward(10)
t.right(90)
t.forward(10)
t.right(90)
t.forward(10)
@felipecabargas
felipecabargas / histograma.py
Last active December 16, 2015 10:09
Histograma from progra.usm.cl
pos = 0
neg = 0
print "Ingrese varios valores, termine con cero:"
c = '*'
while True:
num = int(raw_input())
if num == 0:
@felipecabargas
felipecabargas / .profile
Created April 24, 2013 03:56
'.profile' lines to add for get 'django-admin.py' to work under Mac OS X
#-----------------------------------------------------------------------------
# Django+VirtualEnvWrapper
#-----------------------------------------------------------------------------
export PATH=/usr/local/bin:/usr/local/share/python:$PATH
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/share/python/virtualenvwrapper.sh
export PIP_VIRTUALENV_BASE=$WORKON_HOME
@felipecabargas
felipecabargas / programa.py
Last active December 16, 2015 16:40
Módulo y programa para reemplazar puntuación por espacios.
from reemplazar import borrarpuntuacion
entrada = raw_input(">>>")
print borrarpuntuacion(entrada)
@felipecabargas
felipecabargas / nonalphabetic.py
Last active December 16, 2015 21:29
Check character type
def is_number(n):
try:
float(n)
return True
except ValueError:
return False
def is_symbol(n):
if n.isalnum() == False:
return True