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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@camriddell
camriddell / collect_univariates.py
Last active March 8, 2024 20:56
A collection of univariate plots
from functools import partial
from textwrap import fill
from scipy.stats import norm, uniform, skewnorm, gaussian_kde, triang
from numpy import (
array, linspace, quantile, histogram, atleast_2d, mean, std, add
)
from numpy.lib.stride_tricks import sliding_window_view
from matplotlib.pyplot import subplots, show, rc
@cgreer
cgreer / bag_of_little_bootstraps.py
Last active April 13, 2025 14:06
Bag of Little Bootstraps (w/ example usage)
import random
from typing import (
List,
Dict,
Callable,
Union,
)
import numpy
@ZosBHAI
ZosBHAI / Custom_Pyspark_kernel
Created August 2, 2020 16:11
Pyspark Kernel in Anaconda
### Find the kernel.json location
jupyter kernelspec list
###Create Pyspark Folder and create Kernel.json file with below content
{
"display_name": "pyspark",
"language": "python",
"argv": [ "/opt/anaconda3/bin/python", "-m", "ipykernel", "-f", "{connection_file}" ],
"env": {
"JAVA_HOME": "/usr/lib/jvm/java-8-openjdk-amd64",
@ChrisRackauckas
ChrisRackauckas / diffeq_vs_torchsde.md
Last active September 28, 2022 20:49
torchsde vs DifferentialEquations.jl / DiffEqFlux.jl (Julia) benchmarks

torchsde vs DifferentialEquations.jl / DiffEqFlux.jl (Julia)

This example is a 4-dimensional geometric brownian motion. The code for the torchsde version is pulled directly from the torchsde README so that it would be a fair comparison against the author's own code. The only change to that example is the addition of a dt choice so that the simulation method and time step matches between the two different programs.

The SDE is solved 100 times. The summary of the results is as follows:

@korakot
korakot / faiss.py
Last active April 20, 2023 21:47
Install faiss on Google Colab without using Conda
# CPU
!curl -L https://anaconda.org/pytorch/faiss-cpu/1.6.0/download/linux-64/faiss-cpu-1.6.0-py36h6bb024c_0.tar.bz2 | tar xj
# GPU, CUDA 10
# !curl -L https://anaconda.org/pytorch/faiss-gpu/1.6.0/download/linux-64/faiss-gpu-1.6.0-py36h1a5d453_0.tar.bz2 | tar xj
# install
!mv lib/python3.6/site-packages/* /usr/local/lib/python3.6/dist-packages/
import faiss
@bjmiller121
bjmiller121 / multiple-push-urls.md
Last active January 10, 2025 17:07
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 17, 2025 20:49
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@irazasyed
irazasyed / homebrew-permissions-issue.md
Last active January 25, 2025 15:00
Homebrew: Permissions Denied Issue Fix (OS X / macOS)

Homebrew Permissions Denied Issues Solution

sudo chown -R $(whoami) $(brew --prefix)/*

@jessicald
jessicald / gist:2861038
Created June 3, 2012 02:34
Class vs. Dictionary; or, An Example of Space-Time Tradeoff

Class vs. Dictionary; or, An Example of Space–Time Tradeoff in Python

Conclusions; or, tl;dr

What wins?

  • struct-like objects, i.e. ones that are largely the same as a C struct instance, win in the memory department.
    • These tests do not try to determine what is best for very large sets of values, however; I direct the reader to http://stackoverflow.com/a/2670191 for an insight into that scenario when using a dictionary.
  • Dictionaries beat out objects in access times.
  • According to Wikipedia, the Python dictionary is highly optimised because it is used internally to implement namespaces. [citation needed]