Skip to content

Instantly share code, notes, and snippets.

View ValRCS's full-sized avatar

Valdis Saulespurens ValRCS

View GitHub Profile
@ValRCS
ValRCS / flask-serve-static.py
Created July 18, 2018 09:57 — forked from ibigbug/flask-serve-static.py
Very simple static folder server using Flask
from flask import Flask
from flask import request
from flask import jsonify
from flask import send_from_directory
app = Flask(__name__)
@app.route('/', defaults=dict(filename=None))
@ValRCS
ValRCS / spacy_intro.ipynb
Created July 22, 2018 10:29 — forked from aparrish/spacy_intro.ipynb
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ValRCS
ValRCS / StockCandleMatrixBS4_Dow.py
Created July 23, 2018 10:20
Yahoo Finance web scraper for Dow Jones stock prices
# -*- coding: utf-8 -*-
from mpl_finance import candlestick_ohlc
import numpy as np
from matplotlib import pyplot
import pandas as pd
from bs4 import BeautifulSoup
import urllib.request
import re
@ValRCS
ValRCS / word_frequency.py
Created August 22, 2018 09:08 — forked from nmpowell/word_frequency.py
Count words in a text file, sort by frequency, and generate a histogram of the top N
#!/usr/bin/python
"""Python script to create a histogram of words in a text file.
Usage: python word_frequency.py -f "/path/to/file.txt" -n 200
Specify the path to the text file as above. Manually specify the top N words to report (default 100).
Text file can contain punctuation, new lines, etc., but special characters aren't handled well.
@ValRCS
ValRCS / CouchDB_Python.md
Created September 4, 2018 19:21 — forked from marians/CouchDB_Python.md
The missing Python couchdb tutorial

This is an unofficial manual for the couchdb Python module I wish I had had.

Installation

pip install couchdb

Importing the module

@ValRCS
ValRCS / bash-cheatsheet.sh
Created January 9, 2019 10:28 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04

Windows to UNIX Command Cheat Sheet

Windows PowerShell has several transition aliases that allow UNIX and CMD users to use familiar command names in Windows PowerShell. The most common aliases are shown in the table below, along with the Windows PowerShell command behind the alias and the standard Windows PowerShell alias if one exists.

CMD Command UNIX Command PowerShell Command PowerShell Alias
dir ls Get-ChildItem gci
@ValRCS
ValRCS / pdf_to_text.py
Created October 8, 2019 11:29 — forked from nadya-p/pdf_to_text.py
Extract text contents of PDF files recursively
from tika import parser
import os
def extract_text_from_pdfs_recursively(dir):
for root, dirs, files in os.walk(dir):
for file in files:
path_to_pdf = os.path.join(root, file)
[stem, ext] = os.path.splitext(path_to_pdf)
if ext == '.pdf':
@ValRCS
ValRCS / download_analog_dialogue.py
Created July 14, 2020 19:41 — forked from dantler/download_analog_dialogue.py
Download Analog Dialogue
# Download all of Analog Dialogue
# Generates a lot of 404 errors, but ultimately gets the job done quickly
# without producing any extra cruft on your HDD.
import os
volumes = range(1,54)
numbers = range(1,4)
url_base = "https://www.analog.com/media/en/analog-dialogue/"
url_list = []
@ValRCS
ValRCS / download_analog_dialogue.py
Created July 14, 2020 19:41 — forked from dantler/download_analog_dialogue.py
Download Analog Dialogue
# Download all of Analog Dialogue
# Generates a lot of 404 errors, but ultimately gets the job done quickly
# without producing any extra cruft on your HDD.
import os
volumes = range(1,54)
numbers = range(1,4)
url_base = "https://www.analog.com/media/en/analog-dialogue/"
url_list = []