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
| """ | |
| Transformer in ~80 lines of code. | |
| From Thomas Wolf's tweet https://twitter.com/Thom_Wolf/status/1129658539142766592. | |
| """ | |
| import torch | |
| from torch import nn | |
| class Transformer(nn.Module): |
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
| # Generate PDFs from the Markdown source files | |
| # | |
| # In order to use this makefile, you need some tools: | |
| # - GNU make | |
| # - Pandoc | |
| # - LuaLaTeX | |
| # - DejaVu Sans fonts | |
| # Directory containing source (Markdown) files | |
| source := src |
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
| # Makefile | |
| # | |
| # Converts Markdown to other formats (HTML, PDF, DOCX, RTF, ODT, EPUB) using Pandoc | |
| # <http://johnmacfarlane.net/pandoc/> | |
| # | |
| # Run "make" (or "make all") to convert to all other formats | |
| # | |
| # Run "make clean" to delete converted files | |
| # Convert all files in this directory that have a .md suffix |
To support my open-source work, consider adding me on Patreon.
An easy to refer to document for regularly setting up macOS 10.15 Catalina.
The topic of recipe-based frequent fresh reinstalls of macOS is a controversial issue. Some people are against reinstalling macOS, citing that they have never had an issue with Apple provided upgrade installs.
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
| #!/usr/bin/env python3 | |
| """ | |
| Download all ClassDojo photos and videos in your timeline. | |
| by kecebongsoft | |
| How it works: | |
| 1. Fetch list of items in the timeline, if there are multiple pages, | |
| it will fetch for all pages. |
Backtrader does not allows natively for trading on Binance however it supports CCXT which is an universal interface to multiple exchanges. This example uses CCXT to allow Backtrader perform trades on this exchange.
Create virtualenv, install ccxt store for backtrader:
pip install git+git://github.com/Dave-Vallance/bt-ccxt-store@master#bt-ccxt-storeand backtrader package
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 Binance: | |
| def __init__(self, key, secret, test=False): | |
| self.exchange = ccxt.binance({ | |
| 'apiKey': key, | |
| 'secret': secret, | |
| 'enableRateLimit': True, | |
| }) | |
| self.test = test | |
| def buy(self, symbol, amount): |
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
| .language as $lang | | |
| { | |
| "metadata" : { | |
| "kernelspec": { | |
| "display_name": "Python 3 (ipykernel)", | |
| "language": "python", | |
| "name": "python3" | |
| }, | |
| "language_info": { | |
| "codemirror_mode": { |