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 time | |
from watchdog.observers import Observer | |
from watchdog.events import FileSystemEventHandler | |
import envoy | |
import os | |
import datetime | |
class NotebookConverterHandler(FileSystemEventHandler): | |
def on_modified(self, event): | |
if event.src_path.endswith('.ipynb'): |
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
// ==UserScript== | |
// @name Show Image Alt Text | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description https://www.reddit.com/r/chrome_extensions/comments/qhpcw4/looking_for_an_extension_that_will_always_show/ | |
// @author You | |
// @match http*://* | |
// @grant none | |
// ==/UserScript== |
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
// ==UserScript== | |
// @name Filter Youtube Homepage by Age | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove Youtube videos from homepage that are over x years old | |
// @author @Glench | |
// @match https://www.youtube.com/ | |
// @icon https://www.google.com/s2/favicons?domain=youtube.com | |
// @grant none | |
// ==/UserScript== |
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
function is_loading() { | |
return document.querySelector('#UpdateProgress3').getAttribute('aria-hidden') == 'false'; | |
} | |
function wait_till_load_done() { | |
setTimeout(function() { | |
if (!is_loading()) { | |
scrape_table() | |
} else { | |
wait_till_load_done(); |
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
""" | |
We want to run a function asychronously and run a | |
callback function with multiple parameters when it | |
returns! | |
In this example, we are pretending we're analyzing | |
the names and ages of some people. We want to print | |
out: | |
jack 0 |
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
#!/usr/bin/python | |
# a script to get all the common tropes for media from tv tropes | |
# usage: | |
# python tv_tropes_matcher.py name1 name2 [name3...nameN] | |
# please put names with spaces or special characters in quotes | |
# you can also pass in the urls if it won't automatch by name. | |
# pip install pattern | |
# pip install pyquery |
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
<script context="backend"> | |
// /routes/index.svelte | |
import db from '/db'; | |
export async function get(req, abort, redirect) { | |
const user = await db.User.findOne({where: {id: req.query.user_id}}); | |
return {user} | |
} | |
</script> |
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
{ | |
// sets everything but stage to black on full-screened https://scratch.mit.edu/projects/editor/ | |
const stage = document.querySelector('[class^="stage_stage-bottom-wrapper"]') | |
const rect = stage.getBoundingClientRect(); | |
const pageHeight = document.documentElement.scrollHeight; | |
var leftCover = document.createElement('div'); |
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 Python file uses the following encoding: utf-8 | |
import subprocess | |
import time | |
breathing_time = 30 # seconds | |
interval_between_breathing = 25 * 60 # seconds | |
applescript = """ | |
display dialog "Breathe and make a home of your body" ¬ |
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 play | |
@play.when_any_key_pressed | |
def do(key): | |
text = play.new_text(':(', y=play.screen.bottom) | |
text.start_physics(x_speed=play.random_number(-20,20), y_speed=100, bounciness=.3) | |
play.start_program() |
NewerOlder