Skip to content

Instantly share code, notes, and snippets.

View thinkjrs's full-sized avatar
🎯
Focusing

Jason R. Stevens, CFA thinkjrs

🎯
Focusing
View GitHub Profile
@thinkjrs
thinkjrs / dash_app_template.py
Created July 31, 2018 14:04 — forked from alysivji/dash_app_template.py
Dash app template
# standard library
import os
# dash libs
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import plotly.figure_factory as ff
import plotly.graph_objs as go
@thinkjrs
thinkjrs / nasdaq_finance.py
Created October 3, 2018 01:40 — forked from scrapehero/nasdaq_finance.py
Script to scrape financial data from NASDAQ
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from lxml import html
import requests
from time import sleep
import json
import argparse
from random import randint
@thinkjrs
thinkjrs / .bash_profile
Created December 29, 2019 03:11
Git-focused .bash_profile
#
# Functionality to supercharge git usage.
#
# Things you can do from your bash shell:
# =============
# $ # clone a new repo & bootstrap its setup w/git-flow
# $ gcl my-repo
# $ # commit updated changes w/a push hook for the feature branch you updated
# $ gc "my sweet feature update to squash the :beetle:"
# $ gpf ch1009
# Musicfox Individual Contributor License Agreement
In order to clarify the intellectual property license granted with Contributions from any person or entity, Musicfox, Inc. ("Musicfox") must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of Musicfox; it does not change your rights to use your own Contributions for any other purpose.
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Musicfox. Except for the license granted herein to Musicfox and recipients of software distributed by Musicfox, You reserve all right, title, and interest in and to Your Contributions.
1. Definitions.
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Musicfox. For legal entities, the entity making a
@thinkjrs
thinkjrs / StackOverflowOverflow
Created September 4, 2020 11:23
Stack overflow answers I've deleted for some reason or other.
Pytest uses the same `-W` warning flags as @anakhand mentioned in comment. So, to disable warnings you should be able add the following flag to your pytest invokation:
```python
pytest -Wignore
```
To make this automagic add to your `pytest.ini`:
```python
[pytest]
@thinkjrs
thinkjrs / ghactions-npm-private-setup.md
Last active October 3, 2020 00:13
Github Actions setup - Private NPM Package

Installing a private NPM package in a Github Action

Firstly, this is based on the short post here.

The problem?

You need to create an .npmrc file on the fly via your github actions .yml script.

The solution

Separate steps and echo your environment variable from NPM, set in Github (at Musicfox NPM_AUTH_TOKEN), and pre-write a fresh .npmrc.

⚠️ Steps are not in order! ⚠️

Creating Your Next.js Sitemap & robots.txt

This simple tutorial demonstrates how to create a static sitemap for Next.js applications.

We generally follow Lee Robinson's excellent post on the topic. Thanks Lee!

So what is a sitemap?

Very simply, a sitemap is a simple file providing search engines instructions to accurately (hopefully) index your site. This simple file functions similarly to a map, but in a format Google and other search engines have agreed to follow with their crawlers/indexers.

Check out a deeper dive in Wikipedia for details on why and what.

Let's go

@thinkjrs
thinkjrs / ubuntu-yarn-installation.md
Created November 10, 2020 18:50
Installing Yarn on Ubuntu 20.04

Background

We use nvm for node.js version management and will thus skip the automatic installation of node.js by the sudo apt install yarn command, below.

⚠️ This guide assumes you've got node.js already installed! ⚠️

Installation steps

  1. Acquire yarn's public key and add it to apt.
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
@thinkjrs
thinkjrs / web-dev-best-practices.md
Last active November 20, 2020 20:21
Notes on best practices for web development.

Best practices for the web

Add width and height to <img>

This helps browsers render the page faster with less CPU, plus keeps an image from causing page jump. See this css working group issue for more.

<style>
  img {
    width: 100%;
 height: auto;