Skip to content

Instantly share code, notes, and snippets.

View duartenina's full-sized avatar

Duarte Nina duartenina

View GitHub Profile
@duartenina
duartenina / dnina.omp.json
Last active May 14, 2023 19:16
OhMyPosh Profile
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"version": 2,
"final_space": true,
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
@duartenina
duartenina / minecraft_1_18.md
Last active January 9, 2022 16:32
Minecraft 1.18

You can add markers to DynMap. Easiest way is to place a sign with lines:

[dynmap]
<name of marker>
(optional) icon:<icon>

Biome key here.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
from findiff import FinDiff
import matplotlib.pyplot as plt
import findiff
print(findiff.__version__)
def f(x):
return x * np.exp(-x**2)
def df_dx(x):
import numpy as np
from findiff import FinDiff
import matplotlib.pyplot as plt
import findiff
print(findiff.__version__)
def f(x):
return x * np.exp(-x**2)
def df_dx(x):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@duartenina
duartenina / chimeclicker.py
Created January 17, 2016 20:23
ChimeClicker
# coding: utf-8
# In[107]:
import numpy as np
import matplotlib.pyplot as plt
get_ipython().magic('matplotlib inline')
def build_min_table(self):
self.mins = {}
for ID in range(1, len(self.mapa.cities) + 1):
self.mins[ID] = {}
connects = self.mapa.cities[ID - 1].connects
if len(connects) < 1:
for kind in self.kinds:
self.mins[ID][kind] = 10**6
return
@duartenina
duartenina / number_trick.py
Created July 11, 2014 14:16
Number trick (always gets 13)
def get_max_exponent (n):
n_copy = int(n)
n_max = 0
while True:
div = 10**n_max
if (n_copy//div)*div == 0:
break
n_max += 1
return n_max - 1 #To get the break condition, it's needed the first exponent larger than the number