Skip to content

Instantly share code, notes, and snippets.

View stanlee321's full-sized avatar

Stanley Salvatierra stanlee321

View GitHub Profile
import streamlit as st
import pandas as pd
from vega_datasets import data
"""
# Using different charting libraries
"""
@st.cache
@stanlee321
stanlee321 / docker-cleanup-resources.md
Created October 13, 2020 04:51 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@stanlee321
stanlee321 / tmux-cheats.md
Created September 12, 2020 03:37 — forked from Starefossen/tmux-cheats.md
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@stanlee321
stanlee321 / tmux.md
Created September 12, 2020 03:37 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@stanlee321
stanlee321 / curl_post_json.md
Created July 19, 2020 23:56 — forked from ungoldman/curl_post_json.md
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@stanlee321
stanlee321 / rem_outlier.py
Created August 24, 2019 03:17 — forked from ariffyasri/rem_outlier.py
Remove outliers in pandas
import pandas as pd
import numpy as np
from pandas.api.types import is_numeric_dtype
np.random.seed(42)
age = np.random.randint(20,100,50)
name = ['name'+str(i) for i in range(50)]
address = ['address'+str(i) for i in range(50)]
@stanlee321
stanlee321 / rem_outlier.py
Created August 24, 2019 03:17 — forked from ariffyasri/rem_outlier.py
Remove outliers in pandas
import pandas as pd
import numpy as np
from pandas.api.types import is_numeric_dtype
np.random.seed(42)
age = np.random.randint(20,100,50)
name = ['name'+str(i) for i in range(50)]
address = ['address'+str(i) for i in range(50)]
@stanlee321
stanlee321 / streams_and_event_loop.dart
Created June 8, 2019 16:18 — forked from sethladd/streams_and_event_loop.dart
Streams, stream controller, and event loops in Dart.
import 'dart:async';
import 'dart:math';
/*
* Findings:
* streams can be single or broadcast, but not sure why the diff.
* can check if a stream is broadcast with isBroadcast
* StreamController make it easy to use a stream and send it events
*/
import numpy as np
from keras import backend as K
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.preprocessing.image import ImageDataGenerator
from sklearn.metrics import classification_report, confusion_matrix
#Start
train_data_path = 'F://data//Train'
@stanlee321
stanlee321 / stock_price_autoencoding.ipynb
Created April 24, 2019 03:54 — forked from GerardBCN/stock_price_autoencoding.ipynb
Stock market Bitcoin data compression with autoencoders
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.