Skip to content

Instantly share code, notes, and snippets.

@greencoder
greencoder / fetch_audio.sh
Created July 31, 2020 16:20
Download Audio from YouTube as MP3
youtube-dl --extract-audio --audio-format mp3 <youtube-url>
@greencoder
greencoder / gist:f52af91b8e4e7208e797a2b79c49415c
Last active June 24, 2020 19:51
Save your weather from MeteoNook
const years = [2020, 2021, 2022];
const months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
const days = Array.from({length:31},(v,k)=>k+1)
var dailyConditions = [];
var titleRegex = /\(([^)]+)\)/;
years.forEach(year => {
months.forEach(month => {
days.forEach(day => {
@greencoder
greencoder / install.txt
Created July 26, 2019 04:20
Get psycopg2 to install on Mojave
https://stackoverflow.com/questions/26288042/error-installing-psycopg2-library-not-found-for-lssl
$ env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2
@greencoder
greencoder / fetch.py
Last active July 9, 2018 19:19
Fetches the mean average temperature and the mean observed average temperature
body = {
'sid': 'DENthr',
'sdate': '2018-01-01',
'edate': '2018-06-31',
'output': 'json', # csv or json
'elems': [
{
"name": "avgt",
"interval": "mly",
"duration": "mly",
@greencoder
greencoder / files.txt
Created January 2, 2018 16:39
Joining Multiple Files with FFMpeg
# List each file in order
file '/path/to/file1.mov'
file '/path/to/file2.mov'
file '/path/to/file3.mov'
@greencoder
greencoder / predict.py
Last active July 27, 2022 19:32
SKLearn Linear Regression Stock Price Prediction
from __future__ import print_function
import numpy as np
import pandas as pd
import talib as ta
import pandas_datareader as web
from sklearn.linear_model import LinearRegression
from sklearn.linear_model import Ridge
from sklearn.model_selection import cross_val_score
@greencoder
greencoder / NOAA Data.ipynb
Last active August 27, 2017 04:57
Pandas Parsing of NOAA Historical Data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@greencoder
greencoder / fetch_station.py
Last active July 7, 2017 19:52
Fetching Historical Observations from ACIS (Using either curl or Python)
import argparse
import json
import re
import sys
import urllib2
# Parse the command-line arguments
argparser = argparse.ArgumentParser()
argparser.add_argument('date_start', help='Start Date')
argparser.add_argument('date_end', help='End Date')
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@greencoder
greencoder / fetch_240.py
Created February 6, 2017 21:32
Email myself the Weather 5280 10-Day Accumulated Snowfall Plot
import requests
import smtplib
import sys
import time
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email.MIMEImage import MIMEImage
from email import Encoders