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
| # remap prefix from 'C-b' to 'C-a' | |
| unbind C-b | |
| set-option -g prefix C-a | |
| bind-key C-a send-prefix | |
| # split panes using | and - | |
| bind | split-window -h | |
| bind - split-window -v | |
| unbind '"' | |
| unbind % |
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
| from functools import wraps | |
| import os | |
| import re | |
| import subprocess | |
| from pathlib import Path | |
| from typing import Literal | |
| from urllib.parse import quote_plus, unquote_plus, urlencode, urljoin | |
| from uuid import uuid4 | |
| import requests |
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
| #!/bin/bash | |
| set -o errexit | |
| # rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune | |
| # git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch python/rotate-2d-matrix.py" HEAD | |
| # git push origin master --force | |
| # Script to permanently delete files/folders from your git repository. To use | |
| # it, cd to your repository's root and then run the script with a list of paths | |
| # you want to delete, e.g.: | |
| # git-delete-history path1 path2 |
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 os | |
| ASSUMPTIONTS_MAP = {} | |
| ASSUMPTIONTS_MAP['CALM'] = { | |
| 'name': 'Cal-Maine Foods, Inc.', | |
| 'current_stock_price': 57, | |
| 'value_scale': '$mil', | |
| 'share_count_scale': 'mil', | |
| 'shares_outstanding': 49.0, # mil |
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
| package problems; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| /** | |
| * | |
| * @author lucas | |
| * | |
| * Example: |
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 glob | |
| import os | |
| import argparse | |
| def rename(dir, pattern, new_title): | |
| count = 1 | |
| for path_and_filename in glob.iglob(os.path.join(dir, pattern)): | |
| title, ext = os.path.splitext(os.path.basename(path_and_filename)) | |
| os.rename(path_and_filename, os.path.join(dir + '/', new_title + ('-%s' % count) + ext)) |
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 os | |
| import sys | |
| import re | |
| def strip(path: str): | |
| with open(path, "r") as html_file: | |
| content = html_file.read() | |
| body_start_index = content.find('<body>') | |
| body_end_index = content.find('</body>') |
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
| from bs4 import BeautifulSoup | |
| import os | |
| import sys | |
| def strip(path:str): | |
| with open(path, "r") as html_file: | |
| content = html_file.read() | |
| soup = BeautifulSoup(content, 'html.parser') | |
| body = soup.find('body').prettify() | |
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 requests | |
| import pandas as pd | |
| import csv | |
| def historical_prices(symbol:str): | |
| symbol = symbol.lower() | |
| url = "https://www.nasdaq.com/symbol/{0}/historical".format(symbol) | |
| headers = {'content-type' : 'application/json'} | |
| data = "10y|true|{0}".format(symbol) | |
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 requests | |
| import bs4 as bs | |
| import csv | |
| import re | |
| def historical_prices(symbol:str): | |
| url = "https://www.nasdaq.com/symbol/{0}/historical".format(symbol) | |
| headers = {'content-type' : 'application/json'} | |
| data = "10y|false|{0}".format(symbol) | |
| resp = requests.post(url, data=data, headers=headers) |
NewerOlder