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
from google.colab import userdata | |
key = userdata.get('MY_APY_KEY') |
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
print("Runtime is now restarting...") | |
print("You can ignore the error message [Your session crashed for an unknown reason.]") | |
sleep(0.5) | |
os._exit(0) # restart |
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
# all imports | |
from IPython.display import Javascript | |
from google.colab import output | |
from base64 import b64decode | |
from io import BytesIO | |
!pip -q install pydub | |
from pydub import AudioSegment | |
RECORD = """ | |
const sleep = time => new Promise(resolve => setTimeout(resolve, time)) |
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
# authenticate | |
from google.colab import auth | |
auth.authenticate_user() | |
import gspread | |
from oauth2client.client import GoogleCredentials as GC | |
gc = gspread.authorize(GC.get_application_default()) | |
# create, and save df | |
from gspread_dataframe import set_with_dataframe | |
title = 'New Sheet' | |
gc.create(title) # if not exist |
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
# install chromium, its driver, and selenium | |
!apt update | |
!apt install libu2f-udev libvulkan1 | |
!wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | |
!dpkg -i google-chrome-stable_current_amd64.deb | |
!wget https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5993.70/linux64/chromedriver-linux64.zip | |
!unzip -j chromedriver-linux64.zip chromedriver-linux64/chromedriver -d /usr/local/bin/ | |
!pip install selenium chromedriver_autoinstaller | |
# set options to be headless, .. |
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
!unzip -j archive.zip path/to/file.txt | |
!unzip -j archive.zip path/to/file.txt -d /to/path/ | |
# download and unzip in one line, quietly | |
!wget -qO- http://host.com/file.zip | jar x | |
!curl -s http://host.com/file.zip | jar x |
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
from IPython.display import HTML, Image | |
from google.colab.output import eval_js | |
from base64 import b64decode | |
canvas_html = """ | |
<canvas width=%d height=%d></canvas> | |
<button>Finish</button> | |
<script> | |
var canvas = document.querySelector('canvas') | |
var ctx = canvas.getContext('2d') |
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
dmtoolkit.magejosh.repl.co | |
seo-plugin.orrenprunckun.com | |
talkfpl.beegreeeen.workers.dev | |
videohighlight.com | |
aiplugin-experiences.owlting.com | |
www.nani.ooo | |
jetbook.click | |
imageeditor.dev | |
api.speedybrand.io | |
c-resume.copilot.us |
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
import os | |
import sys | |
from contextlib import contextmanager | |
@contextmanager | |
def suppress_stdout(): | |
with open(os.devnull, 'w') as devnull: | |
original_stdout = sys.stdout | |
sys.stdout = devnull | |
try: |
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
from google.colab import output | |
output.clear() | |
# IPython also has clear_output() but this is shorter. | |
from IPython.display import clear_output |
NewerOlder