- Open Automator
- Create a new Service
- Add a
Run Shell Script
action - Set input to Service receives selected
files or folders
inany application
- Set the script action to
/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n $@
- Set Pass input to
as arguments
- Save as
Open in Sublime Text
This file contains 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
""" | |
Monitor a Dropbox folder daily at 5 PM. For each PDF file, send its contents to OpenAI GPT-3.5 | |
to generate a two-sentence summary/action. Collect all summaries and send them via WhatsApp. | |
NOTE: This example code is written in a functional style with separate functions for each step. | |
Fill in the auth tokens and any additional settings in the commented sections. | |
Dependencies you might need to install: | |
pip install dropbox openai PyPDF2 requests schedule |
This file contains 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
Rank Country Name PageRank | |
------------------------------------------------------------------------ | |
1. Namibia 0.1569 | |
2. China 0.0147 | |
3. Russian Federation 0.0119 | |
4. Brazil 0.0099 | |
5. Germany 0.0085 | |
6. France 0.0084 | |
7. Zambia 0.0083 | |
8. Saudi Arabia 0.0078 |
This file has been truncated, but you can view the full file.
This file contains 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
First Citizen: | |
Before we proceed any further, hear me speak. | |
All: | |
Speak, speak. | |
First Citizen: | |
You are all resolved rather to die than to famish? | |
All: |
This file contains 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 time | |
import pandas as pd | |
from googleapiclient.discovery import build | |
# Enter your API key here | |
api_key = "API KEY HERE" | |
# Create a service object for the YouTube API | |
youtube = build('youtube', 'v3', developerKey=api_key) |
This file contains 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
function addpythonpath { | |
PYTHONPATH=$PYTHONPATH:`pwd` | |
sed -i '' '/^PYTHONPATH/d' ~/.bashrc | |
sleep .5 | |
echo PYTHONPATH=$PYTHONPATH >> ~/.bashrc | |
} | |
# install yt-dlp first for this to work. | |
# streams youtube videos via VLC. | |
function ytvlc { |
This file contains 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 pandas as pd | |
import numpy as np | |
def style_dataframe(df, maxvals=None): | |
result = df.style | |
result.set_properties(**{'text-align': 'center'}) | |
result.set_properties(**{'font-family': 'monospace'}) | |
result.set_properties(**{'font-weight': 'bold'}) | |
result.set_table_styles([ |
This file contains 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
# generate private key | |
openssl genrsa -out private_key.pem 4096 | |
# extract public key | |
openssl rsa -in private_key.pem -pubout > public_key.pub | |
# sign using private key | |
openssl dgst -sign private_key.pem -keyform PEM -sha256 -out VGG_ILSVRC_16_layers.caffemodel.sign -binary VGG_ILSVRC_16_layers.caffemodel | |
# extract using public key |
This file contains 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
# command to install this library. | |
# conda install pandas-datareader | |
# example 1 | |
import pandas_datareader as pdr | |
tsla = pdr.DataReader('tsla', data_source='google', start='2017-1-1') | |
# example 2 | |
# calculates the trailing stop order price, can be used for weight loss like time series as well. |
NewerOlder