Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ismael Venegas Castelló SalchiPapa

🎯
Focusing
View GitHub Profile
View foo.tex
\documentclass[a4paper,10pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{geometry}
\usepackage{graphicx}
\author{Ismaelo}
\title{Bar}
\date{\today}
View fib_primes.py
import math
def erathostenes(n):
primes = list(range(2, n+1))
i = 2
while(i <= int(math.sqrt(n))):
if i in primes:
for j in list(range(i*2, n+1, i)):
if j in primes:
primes.remove(j)
View primes.py
import math
def erathostenes(n):
primes = list(range(2, n+1))
i = 2
while(i <= int(math.sqrt(n))):
if i in primes:
for j in list(range(i*2, n+1, i)):
if j in primes:
primes.remove(j)
View fib_memo.py
CACHE = {0: 0, 1: 1}
def fib_memo(n):
if n not in CACHE:
print("Computing new value.")
CACHE[n] = fib_memo(n-1) + fib_memo(n-2)
print("Fetching value from cache.")
return CACHE[n]
@SalchiPapa
SalchiPapa / fib_session.py
Created Sep 7, 2019
Curso explicación fib.
View fib_session.py
def fib(n):
if n < 2:
return n
else:
return fib(n-1) + fib(n-2)
def fib_seq(n):
"""
Calcula la secuencia de fibonacci hasta n
@SalchiPapa
SalchiPapa / pila.py
Last active Aug 24, 2019
Pila en Python.
View pila.py
class Pila:
"""Una pila (stack en inglés) es una lista ordenada o
estructura de datos que permite almacenar y recuperar datos,
siendo el modo de acceso a sus elementos de tipo LIFO
(del inglés Last In, First Out, «último en entrar, primero en
salir») .
Esta estructura se aplica en multitud de supuestos en el área
de informática debido a su simplicidad y capacidad de dar
respuesta a numerosos procesos
@SalchiPapa
SalchiPapa / .tmux.conf.local
Created Aug 13, 2019
OhMyTmux Config File
View .tmux.conf.local
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# -- navigation ----------------------------------------------------------------
# if you're running tmux within iTerm2
# - and tmux is 1.9 or 1.9a
View gist:27189c91cb576fb3861e042122126861
Compiling: keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c In file included from quantum/rgblight.h:136:0,
from quantum/quantum.h:38,
from keyboards/ergodox_ez/ergodox_ez.h:4,
from keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c:1:
quantum/rgblight_list.h:27:26: error: expected identifier before numeric constant
#define RGB_GREEN 0x00, 0xFF, 0x00
^
keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/custom_keycodes.c:4:5: note: in expansion of macro ‘RGB_GREEN’
RGB_GREEN, // To set default RGB layer as green once.
^
View gist:96d73964ed1fe14915dd152e9870b0ca
FAILED: ../../../src/ninja cd /data/data/com.termux/files/usr/tmp/pip-install-pecgye5u/ninja/src && /data/data/com.termux/files/usr/bin/python configure.py --bootstrap ./src/util.cc:578:7: error: use of undeclared identifier 'getloadavg' if (getloadavg(loadavg, 3) < 0) { ^ 1 error generated. bootstrapping ninja... warning: A compatible version of re2c (>= 0.11.3) was not found; changes to src/*.in.cc will not affect your build. when running: g++ -MMD -MT build/util.o -MF build/util.o.d -g -Wall -Wextra -Wno-deprecated -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti -fno-exceptions -fvisibility=hidden -pipe '-DNINJA_PYTHON="python"' -O2 -DNDEBUG -fdiagnostics-color
@SalchiPapa
SalchiPapa / charmdb.py
Created May 29, 2019
pydevd-pycharm wrapper.
View charmdb.py
#!/usr/bin/env python
import os
try:
import pydevd_pycharm as pycharm
except ImportError:
raise EnvironmentError(
"Please install PyCharm's PyDev support: pip install pydevd-pycharm"
)
You can’t perform that action at this time.