Skip to content

Instantly share code, notes, and snippets.

View andfanilo's full-sized avatar
🎈
Streamlitin'

Fanilo Andrianasolo andfanilo

🎈
Streamlitin'
View GitHub Profile
@debasishg
debasishg / gist:8172796
Last active July 5, 2024 11:53
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&rep=rep1&t
@iandanforth
iandanforth / canvascapture.md
Last active October 5, 2022 10:57
Capture WebGL frames to disk

How to capture WebGL/Canvas by piping data over a websocket.

This Gist builds on https://gist.github.com/unconed/4370822 from @unconed.

Instead of the original method which writes to the browsers sandboxed filesystem here we use a websocket connection provided by websocketd to pipe image data to a short python script that writes out the .png files to disk.

Install websocketd

@parmentf
parmentf / GitCommitEmoji.md
Last active July 4, 2024 10:57
Git Commit message Emoji
@fperez
fperez / README.md
Last active July 1, 2021 04:43
Polyglot Data Science with IPython

Polyglot Data Science with IPython & friends

Author: Fernando Pérez.

A demonstration of how to use Python, Julia, Fortran and R cooperatively to analyze data, in the same process.

This is supported by the IPython kernel and a few extensions that take advantage of IPython's magic system to provide low-level integration between Python and other languages.

See the companion notebook for data preparation and setup.

@jeff3dx
jeff3dx / d3-in-react.js
Last active October 27, 2022 09:24
D3 in React with Hooks
import React, { useRef, useEffect } from 'react';
import * as d3 from 'd3';
interface IProps {
data?: number[];
}
/* Component */
export const MyD3Component = (props: IProps) => {
/* The useRef Hook creates a variable that "holds on" to a value across rendering
@tvst
tvst / SessionState.py
Last active April 14, 2024 20:24
DO NOT USE!!! Try st.session_state instead.
"""Hack to add per-session state to Streamlit.
Usage
-----
>>> import SessionState
>>>
>>> session_state = SessionState.get(user_name='', favorite_color='black')
>>> session_state.user_name
''
worker_processes 1;
events {
worker_connections 1024;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
from tkinter import *
from PIL import ImageTk,Image
import time
import os
targetImageWidth = 850
targetImageHeight = 400
inputImageWidth = 0
inputImageHeight = 0
@swyxio
swyxio / Tailwindcssunreset.scss
Last active February 14, 2024 01:19
Tailwind CSS Un-Reset - un-reset Tailwind's Preflight CSS Reset so that autogenerated HTML looks consistent with the rest of your Tailwind site. - https://www.swyx.io/writing/tailwind-unreset
.unreset {
a {
@apply text-blue-700 underline;
}
p {
@apply my-4;
}
blockquote,
figure {
@andfanilo
andfanilo / deploy_streamlit_cc.md
Last active May 19, 2022 04:35
Steps to release Streamlit Custom Component package
  1. Pass flag _release to True
  2. Rebuild frontend:
cd package/frontend
rm -rf build/
npm run build
cd ../../
  1. Rebuild Python: