from ftplib import FTP
from datetime import datetime
start = datetime.now()
ftp = FTP('your-ftp-domain-or-ip')
ftp.login('your-username','your-password')
# Get All Files
files = ftp.nlst()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var root_tweet; | |
var tweets = new Array(); | |
var scrollInterval = null; | |
var lastScrollHeight = 0; | |
function autoScroll() { | |
var sh = document.documentElement.scrollHeight; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var get_numeric_table_value = function(id) { | |
let element = document.getElementById(id); | |
return Number(element.textContent) | |
}; | |
let ask = get_numeric_table_value('ask0'); | |
let bid = get_numeric_table_value('bid0'); | |
let avg = (bid + ask) / 2 ; |
if the implementation is recent emojis, then we could use a deque. The deque will be instantiated with a max length of 30 which is consistent with what Apple uses.
from collections import deque
recent_emojis = deque([], maxlen=30)
def update_recent_emojis(emoji_used, recent_emojis : deque):
if emoji_used in recent_emojis:
recent_emojis.remove(emoji_used)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /tmp/picblast; cd ~/Pictures/Photos\ Library.photoslibrary; for i in `find . | grep jpegvideocompl`;do ffmpeg -i $i /tmp/picblast/${i:(-8)}.wav; done; cd /tmp/picblast; ffmpeg -safe 0 -f concat -i <( for f in *.wav; do echo "file '$(pwd)/$f'"; done ) ~/Desktop/picblast.wav; rm -rf /tmp/picblast |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/5008828/convert-a-python-type-object-to-a-string | |
type_variety_list : list = [ | |
10, | |
'x', | |
lambda x: x, | |
set(), | |
dict(), | |
[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def reduce_namespace_to_public_only(namespace_directory : list) -> list: | |
""" | |
returns: list of public attribute and or method names | |
""" | |
_is_public_facing = lambda x: not x.startswith('_') | |
public_namespace_only : list = sorted( | |
filter(_is_public_facing, namespace_directory) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import streamlit as st | |
import pandas as pd | |
# Reuse this data across runs! | |
read_and_cache_csv = st.cache(pd.read_csv) | |
BUCKET = "https://streamlit-self-driving.s3-us-west-2.amazonaws.com/" | |
data = read_and_cache_csv(BUCKET + "labels.csv.gz", nrows=1000) | |
desired_label = st.selectbox('Filter to:', ['car', 'truck']) | |
st.write(data[data.label == desired_label]) |