Skip to content

Instantly share code, notes, and snippets.

View emptymalei's full-sized avatar
📡
sending EM waves to Mars

LM emptymalei

📡
sending EM waves to Mars
View GitHub Profile
@emptymalei
emptymalei / sunspot.csv
Created September 10, 2024 17:21
Sunspot Dataseddt
date avg_sunspot_area
1875-01-01 213.133333333333
1876-01-01 109.283333333333
1877-01-01 92.8583333333333
1878-01-01 22.2166666666667
1879-01-01 36.3333333333333
1880-01-01 446.75
1881-01-01 679.491666666667
1882-01-01 968.025
1883-01-01 1148.90833333333
<!-- Cal inline embed code begins -->
<div style="width:100%;height:100%;overflow:scroll" id="my-cal-inline"></div>
<script type="text/javascript">
(function (C, A, L) { let p = function (a, ar) { a.q.push(ar); }; let d = C.document; C.Cal = C.Cal || function () { let cal = C.Cal; let ar = arguments; if (!cal.loaded) { cal.ns = {}; cal.q = cal.q || []; d.head.appendChild(d.createElement("script")).src = A; cal.loaded = true; } if (ar[0] === L) { const api = function () { p(api, arguments); }; const namespace = ar[1]; api.q = api.q || []; typeof namespace === "string" ? (cal.ns[namespace] = api) && p(api, ar) : p(cal, ar); return; } p(cal, ar); }; })(window, "https://app.cal.com/embed/embed.js", "init");
Cal("init", "just-chat", {origin:"https://cal.com"});
Cal.ns["just-chat"]("inline", {
elementOrSelector:"#my-cal-inline",
calLink: "leima/just-chat",
layout: "month_view"
@emptymalei
emptymalei / pyspark-strange-udf-behavior.ipynb
Last active April 20, 2022 15:15
Beware of python mutable objects in pyspark
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@emptymalei
emptymalei / lollipop_plotly.py
Created January 18, 2022 16:19 — forked from caiotaniguchi/lollipop_plotly.py
Plotting Lollipop Charts with Plotly
import numpy as np
import plotly.offline as pyo
import plotly.graph_objs as go
# Generate a random signal
np.random.seed(42)
random_signal = np.random.normal(size=100)
# Offset the line length by the marker size to avoid overlapping
marker_offset = 0.04
@emptymalei
emptymalei / data.py
Created January 16, 2022 08:48
stemgnn_experiment
import torch
from torch.utils.data import Dataset
class FakeTimeSeriesDataset(Dataset):
def __init__(self, sequence_length, input_length, prediction_length, nodes) -> None:
super().__init__()
self.sequence_length = sequence_length
self.prediction_length = prediction_length
@emptymalei
emptymalei / ci.yml
Created November 15, 2021 14:14 — forked from epicfaace/ci.yml
encrypting an entire github pages (mkdocs) website with staticrypt - replace MY_PASSWORD and "YOUR SITE NAME HERE"
name: Docs
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
name: Build docs
@emptymalei
emptymalei / fetch_data.py
Created August 27, 2021 11:10
Proper HTTP Methods in Python for Data Hoarders
import json
import os
import random
import requests
from loguru import logger
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
@emptymalei
emptymalei / gan_mnist.py
Last active August 10, 2021 23:10
GAN with MNIST Data
import matplotlib.pyplot as plt
import torch
from pathlib import Path
import torchvision
import torchvision.transforms as transforms
from loguru import logger
from torch import nn
import click
from itertools import combinations
class Graph(object):
"""A graph object
"""
def __init__(self, source_nodes, target_nodes, weights=None):
if not isinstance(source_nodes, list):
@emptymalei
emptymalei / Dockerfile
Last active January 21, 2021 16:44
preload data into redis using python script
# This is an experiment
# It is not working
FROM redis:4.0.2-alpine
RUN apk add --no-cache python3 py3-pip
RUN pip3 install click
RUN pip3 install redis
RUN mkdir app
COPY . /app