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/local/bin/python3 | |
import sys | |
from rich.console import Console | |
from rich.table import Table | |
import argparse | |
def chunks(lst, n): | |
"""Yield successive n-sized chunks from lst.""" |
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
set-option -g default-terminal "screen-256color" | |
# set-option -g default-terminal "xterm-256color" | |
# History | |
set -g history-limit 10000 | |
# Start windows at 1 rather than 0 | |
set -g base-index 1 | |
# bind-key -n M-/ copy-mode |
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 argparse | |
import re | |
import os | |
import subprocess | |
from moviepy.editor import VideoFileClip, concatenate_videoclips | |
def get_silences(filename, db, duration): | |
args = "ffmpeg -nostats -i {} -af silencedetect=noise={}dB:d={} -f null -".format( | |
filename, db, duration |
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
alias ve="if [ -d venv ]; then source venv/bin/activate; else virtualenv venv -p python3;source venv/bin/activate; fi" |
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
# stick this in your .bash_profile to create | |
# a static http server on an open port (btw 8000 and 9000) | |
# should work in mac and linux | |
function serve() { | |
# find an open port, from https://unix.stackexchange.com/a/358101 | |
local openport=$(netstat -aln | awk ' | |
$6 == "LISTEN" { | |
if ($4 ~ "[.:][0-9]+$") { | |
split($4, a, /[:.]/); |
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 https://www.nsftools.com/misc/SearchAndHighlight.htm | |
function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag) { | |
// the highlightStartTag and highlightEndTag parameters are optional | |
if (!highlightStartTag || !highlightEndTag) { | |
highlightStartTag = "<span style='color:blue; background-color:yellow;'>"; | |
highlightEndTag = "</span>"; | |
} | |
// find all occurences of the search term in the given text, |
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
var request = require('request'); | |
var fs = require('fs'); | |
var sox = require('sox'); | |
var spawn = require('child_process').spawn; | |
var WATSON_USER = ''; | |
var WATSON_PASS = ''; | |
var url = 'https://stream.watsonplatform.net/speech-to-text/api/v1/recognize'; | |
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
var canvas; | |
var handleVal; | |
var isClicked = false; | |
//var clock; | |
// Class Definition | |
var UiHandle = function (startX, startY, width, height){ | |
this.x = startX; | |
this.y = startY; |
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
var tweet = "These 5 incredible stories from the IDF are sure to leave #inspired"; | |
// turn tweet into an array | |
var words = tweet.split(" "); | |
// get half the length of the words | |
var half_length = Math.ceil(arrayName.length / 2); | |
// get the words on the left side | |
var leftSide = words.splice(0, half_length); |
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 sys | |
import urllib | |
import time | |
import xml.etree.ElementTree as ET | |
chars = 'abcdefghijklmnopqrstuvwxyz' | |
q = sys.argv[1] | |
url = 'http://suggestqueries.google.com/complete/search?output=toolbar&hl=en&q=' + urllib.quote(q.strip() + ' ') | |
def suggest(url): |
NewerOlder