- The example URLs here use the Coding Trains channel ID: UCvjgXvBlbQiydffZU7m1_aw (replace this with your channel id)
- All of the API requests require a YouTube Data API key (no oauth required, just an API key)
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
| // todo: key this by the provided label or just use dependency injection | |
| #let this-counter = counter("info-box") | |
| #let info-box( | |
| title: none, | |
| sections: none, | |
| label: none, | |
| caption: none, | |
| radius: 3pt, | |
| inset: 16pt, |
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
| class AlpacaStarterSystem(DiversifiedStarterSystem): | |
| ''' | |
| Carver's Starter System without stop losses, multiple entry rules, | |
| a forecast for position sizing and rebalancing, and multiple instruments. | |
| Adapted from Rob Carver's Leveraged Trading: https://amzn.to/3C1owYn | |
| Allows live trading via the Alpaca API. | |
| DiversifiedStarterSystem found here: | |
| https://gist.github.com/raposatech/d3f10df41c8745b00cb608bd590a986d |
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 | |
| from yahoo_fin import stock_info as si | |
| from pandas_datareader import DataReader | |
| import numpy as np | |
| tickers = si.tickers_sp500() | |
| recommendations = [] | |
| for ticker in tickers: |
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/sh | |
| git filter-branch --env-filter ' | |
| OLD_EMAIL="[email protected]" | |
| CORRECT_NAME="David Li" | |
| CORRECT_EMAIL="[email protected]" | |
| if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ] | |
| then | |
| export GIT_COMMITTER_NAME="$CORRECT_NAME" | |
| export GIT_COMMITTER_EMAIL="$CORRECT_EMAIL" |
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 | |
| # Simple script to repush docker images from one repository to another | |
| # This is done incremently because my images are massive | |
| original_image="grandfleet/dolwarp" | |
| # github packages has a strange way of having images, you can have | |
| new_image="friendlyuser/dimages/lwarp_docker" | |
| # Github package registry with a repository | |
| target_acr="docker.pkg.github.com" | |
| temp_file="image_list.txt" | |
| rm $temp_file |
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 | |
| # See https://gist.github.com/zhy0/66d4c5eb3bcfca54be2a0018c3058931 | |
| # Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7 | |
| # Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n | |
| ############################################## | |
| ####### BEGIN ANDROID INSTALL ################ | |
| ############################################## | |
| # Install Oracle JDK 8 |
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
| func main() { | |
| // initial request to get csrftoken | |
| resp, err := http.Get("https://api.tmxmoney.com/en/migreport/search") | |
| if err != nil { | |
| // handle error | |
| } | |
| defer resp.Body.Close() | |
| csrftoken := "" | |
| for _, cookie := range resp.Cookies() { |
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
| G = nx.Graph() # or DiGraph, MultiGraph, MultiDiGraph, etc | |
| roadWeight = 4 | |
| i=1 | |
| # Nodes for road vertices | |
| G.add_node("v11",pos=(0,0)) | |
| G.add_node("v21",pos=(1,0)) | |
| G.add_node("v31",pos=(2,0)) | |
| G.add_node("v41",pos=(3,0)) | |
| # "Road Objects" |
NewerOlder