Skip to content

Instantly share code, notes, and snippets.

Avatar

Santiago Basulto santiagobasulto

View GitHub Profile
View Substack Analysis.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@santiagobasulto
santiagobasulto / relative_to_absolute.py
Last active Aug 28, 2020
A quick script to transform a Markdown file's relative images to absolute by uploading them to a plugin-based service (S3, Imgur)
View relative_to_absolute.py
import re
import mimetypes
from pathlib import Path
import requests
import boto3
from botocore.exceptions import ClientError
@santiagobasulto
santiagobasulto / README.md
Last active Jul 7, 2020
A simple calculator from file inputs
View README.md

Example Gist as exercise.

This is the description, and THIS FILE IS MANDATORY.

You can include your markdown description here.

View README.md

In this exercise you will read in a delimited data file as a list of records. Each record will be an instance of InventoryItem. The format of the delimited file is unusual, but can be handled by the Python csv module with appropriate configuration.

For example, the first few lines of data/Inventory.txt contain:

Name|Price|Quantity
/Wankle rotary engine/|555.55|527
/Sousaphone w%/ stand/|333.33|123

Feather Duster|22.22|900
View who_is_hiring.py
# !pip install python-hn
import itertools
from hn import search_by_date
results = search_by_date('Who is hiring?', ask_hn=True, author='whoishiring', hits_per_page=1000)
who_is_hiring = (r for r in results if 'ask hn: who is hiring?' in r['title'].lower())
for elem in itertools.islice(who_is_hiring, 10):
print(elem['title'])
View who_is_hiring.py
# !pip install python-hn
import itertools
from hn import search_by_date
results = search_by_date('Who is hiring?', ask_hn=True, author='whoishiring', hits_per_page=1000)
who_is_hiring = (r for r in results if 'ask hn: who is hiring?' in r['title'].lower())
for elem in itertools.islice(who_is_hiring, 10):
print(elem['title'])
View Hawking.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View general.json
{
"category_name": "General",
"todos": [
{
"task": "My TODO Task",
"due_on": null,
"status": "pending",
"description": null
},
{
You can’t perform that action at this time.