Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Ismael Venegas Castelló SalchiPapa

🎯
Focusing
Block or report user

Report or block SalchiPapa

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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
@SalchiPapa
SalchiPapa / hack.md
Created Oct 4, 2017
Advertise your Discord server...everywhere!
View hack.md

Free people for your Discord server!

Analytics (1005 views in an August week)

Server owners hate me! But today you'll see this one crazy and simple trick to increase your Discord server's size IMMEDIATELY! Wanna reach the same size as the Café does? Advertise as much as you can!

Found more? Ask austinhuang#1076 for edits. No server owners that hate me kthx By the way...

  1. IT IS NOT SUGGESTED TO ADVERTISE IN THE COMMENT BOX IN THIS GIST or register a GitHub account just for commenting here. IF YOU HAVE TO DO SO, PLEASE ADVERTISE RESPONSIBLY. For a long time, I have been tolerant enough and allow you to advertise here. Please don't challenge my limits. Don't spam. Don't stick your damn finger at Ctrl+V. 1 comment per server. No bumps. Or I'll let a script do the job for me (That is, delete every single comment, past and future).
  2. To add your listing server into this list your server must meet
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.