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
# One liner | |
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com | |
# Explained | |
wget \ | |
--recursive \ # Download the whole site. | |
--page-requisites \ # Get all assets/elements (CSS/JS/images). | |
--adjust-extension \ # Save files with .html on the end. | |
--span-hosts \ # Include necessary assets from offsite as well. | |
--convert-links \ # Update links to still work in the static version. |
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
# to get started, try `print get_grammar_complexity_tree(some_grammar, threshold=5)`. | |
# If you don't get any interesting output, turn up the threshold (max depth visualized) to something like 7 or 10 :) | |
class ComplexityNode(object): | |
def __init__(self, item): | |
self.item = item | |
self.children = [] | |
self.total_descendents = 1 | |
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
# Usage: python3 split_audio_by_silence.py -i input_audio.m4a -o segments | |
# will save segments in mp3 format into the segments directory | |
# based on https://github.com/mozilla/DeepSpeech/tree/master/examples/vad_transcriber | |
# Dependencies: webrtcvad | |
import os | |
import argparse | |
import collections | |
import subprocess | |
import webrtcvad |
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
# | |
# This file is a command-module for Dragonfly. | |
# (c) Copyright 2008 by Christo Butcher | |
# Licensed under the LGPL, see <http://www.gnu.org/licenses/> | |
# | |
""" | |
Command-module for Chrome | |
""" |
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
------------------ | |
Grammar(chrome): 3 rules (1 exported, 0 imported): | |
- ChromeRule(chrome) 1571 | |
- Alternative(...) 1570 | |
- Compound('[<click_by_voice_options>] <numbers>') 376 | |
- Sequence(...) 375 | |
- Optional(...) 18 | |
- Choice(..., name='click_by_voice_options') 17 | |
- Compound('click') 2 (+ 1 trivial direct child) | |
- Compound('copy') 2 (+ 1 trivial direct child) |
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
from dragonfly import * | |
import nsformat | |
dictation_length = [] # for "scratch that" purposes | |
input_state = None | |
""" Note: if you pass in the input state into the function using the function action rather than just accessing it | |
from within the function using the fact that it is in global scope, the input state will not be updated | |
when you run the dictation command multiple times | |
To see what I mean note that in contrast to the approach here, the approach taken | |
at the following link does not update the state after each dictation utterance |
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
from __future__ import print_function, unicode_literals | |
from ctypes import windll | |
from dragonfly import (ActionBase, Choice, Grammar, IntegerRef, Key, | |
MappingRule, Mouse, Pause, Repeat) | |
from dragonfly.actions.keyboard import Keyboard, KeySymbols | |
KEYBOARD = Keyboard() |
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
-- autosave.lua | |
-- | |
-- Periodically saves "watch later" data during playback, rather than only saving on quit. | |
-- This lets you easily recover your position in the case of an ungraceful shutdown of mpv (crash, power failure, etc.). | |
-- | |
-- You can configure the save period by creating a "lua-settings" directory inside your mpv configuration directory. | |
-- Inside the "lua-settings" directory, create a file named "autosave.conf". | |
-- The save period can be set like so: | |
-- | |
-- save_period=60 |
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
-- autosave.lua | |
-- | |
-- Periodically saves "watch later" data during playback, rather than only saving on quit. | |
-- This lets you easily recover your position in the case of an ungraceful shutdown of mpv (crash, power failure, etc.). | |
-- | |
-- You can configure the save period by creating a "lua-settings" directory inside your mpv configuration directory. | |
-- Inside the "lua-settings" directory, create a file named "autosave.conf". | |
-- The save period can be set like so: | |
-- | |
-- save_period=60 |
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
javascript:(function() { | |
function copyToClipboard(text) { | |
if (window.clipboardData && window.clipboardData.setData) { | |
/*IE specific code path to prevent textarea being shown while dialog is visible.*/ | |
return clipboardData.setData("Text", text); | |
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) { | |
var textarea = document.createElement("textarea"); | |
textarea.textContent = text; |