Skip to content

Instantly share code, notes, and snippets.

View aladinoster's full-sized avatar
🐢
I'm here to try and learn!

Andres Ladino aladinoster

🐢
I'm here to try and learn!
View GitHub Profile
@aladinoster
aladinoster / gist:ccda8e83768b26243cc6465844161b36
Created October 10, 2019 09:44 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@aladinoster
aladinoster / iterm2-solarized.md
Created January 19, 2020 23:52 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@aladinoster
aladinoster / demo_multipleinheritance.py
Last active August 9, 2021 09:22
Python: Multiple inheritance with different signatures
""" Different signature multiple inheritance
"""
# Explicit is better than implicit
class A:
def __init__(self, a, b):
print(
"Init {} with arguments {}".format(self.__class__.__name__, (a, b))
@aladinoster
aladinoster / demo_dataclass.py
Last active August 9, 2021 09:21
Python: Dataclass initializations
from dataclasses import dataclass, field
@dataclass
class A:
x: int = 1
y: int = 2
z: int = 3
def __init__(self, **kwargs):
@aladinoster
aladinoster / count_elements.py
Created August 9, 2021 05:27
Python: Simple histogram from text or iterables
from collections import Counter
if __name__ == "__main__":
txt = "This is a vast world you can't traverse world in a day"
counts = Counter(txt.split())
print("Here is a sample of counts: ", counts)
print("The most common elements are: ", counts.most_common(2))
@aladinoster
aladinoster / compile_symuflow_osx.sh
Last active October 11, 2021 13:53
CMake: Compile Symuflow
#!/bin/bash
git clone [email protected]:licit-lab/symuflow-dev.git symuflow
cd symuflow
git checkout dev
conda env create -f conda/env.yaml
conda install -c conda-forge cmake -y
conda install -c anaconda make -y
conda install -c anaconda clangxx_osx-64 -y
mkdir build
cd build
@aladinoster
aladinoster / fmm.yaml
Last active October 29, 2021 04:29
Conda: Environment to compile FMM github.com/cyang-kth/fmm
name: fmm
channels:
- conda-forge
- anaconda
dependencies:
- python=3.9
- boost-cpp
- libgdal=3.2.1
- bzip2
- expat
@aladinoster
aladinoster / paralell.py
Created October 28, 2021 13:13
Python: Launch in paralell diferent functions
from multiprocessing import Process
from tqdm import tqdm
from functools import partial
import time
def runInParallel(*fns):
"""
Handle processs in paralell
"""
@aladinoster
aladinoster / conditionalinst.py
Created October 28, 2021 13:21
Python: Conditional instantiation
"""Conditional instantiation"""
class Demo:
"""Class with conditional instantiation"""
def __new__(cls, **kwargs):
if kwargs.get("create"):
return super(Demo, cls).__new__(cls)
return None
@aladinoster
aladinoster / pool.py
Created October 28, 2021 13:28
Python: Pool for smart instance management
""" Pool example for smart memory instantiation"""
class Reusable:
"""Reusable class"""
def test(self):
"""Test function"""
print(f"Using object: {id(self)}")