Skip to content

Instantly share code, notes, and snippets.

@cganterh
cganterh / FizzBuzz.py
Created February 28, 2018 01:01
Python FuzzBuzz oneliner
print(*(''.join(w for m, w in [(3, 'Fizz'), (5, 'Buzz')] if not n%m) or n for n in range(1,101)), sep='\n')
@cganterh
cganterh / factorial_basico.py
Created May 16, 2016 04:10
Calcular el factorial de un número
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
n = int(
raw_input('ingrese un numero: ')
)
m = 1
for i in range(n):
#!/usr/bin/env python
# -*- coding: utf-8 -*-
while True:
cont = 0
suma_irrazabal = 0
suma_ignacio = 0
suma_raul = 0
suma_carolina = 0
suma_isolina = 0
@cganterh
cganterh / test.sh
Created June 16, 2014 20:24
Simple bash script to test the internet connection state.
#!/bin/bash
while true
do
wget -q --tries=10 --timeout=20 -O - http://google.com > /dev/null
if [[ $? -eq 0 ]]; then
echo $(date) "1" | tee -a log.csv
else
echo $(date) "0" | tee -a log.csv
fi