This gist provides the learning-python3.ipynb notebook file, which can be viewed and edited in a Jupyter Notebook server to learn Python 3.
This file contains 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
// Updated: Aug. 20, 2024 | |
// Run: node testRegex.js whatever.txt | |
// Live demo: https://jina.ai/tokenizer | |
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0) | |
// COPYRIGHT: Jina AI | |
const fs = require('fs'); | |
const util = require('util'); | |
// Define variables for magic numbers | |
const MAX_HEADING_LENGTH = 7; |
This file contains 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
wget https://nodejs.org/dist/v6.10.0/node-v6.10.0-linux-x64.tar.xz | |
tar xvfJ node-v6.10.0-linux-x64.tar.xz | |
echo 'export PATH=$HOME/node-v6.10.0-linux-x64/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
This file contains 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
""" This is a convenient way to monkeypatch a method or attribute of a Python | |
object. This is great for situations where you want to modify a global | |
object within a limited scope, i.e., your typical class or module when | |
testing. This was tested and works with Python 2.7 and 3.4. """ | |
import contextlib | |
@contextlib.contextmanager | |
def monkeypatched(object, name, patch): | |
""" Temporarily monkeypatches an object. """ |
This file contains 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 | |
SESSION_NAME="big_red" | |
cd ~/Sites/within3/big_red | |
tmux has-session -t ${SESSION_NAME} | |
if [ $? != 0 ] | |
then |