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 | |
# dependencies = [ | |
# "SpeechRecognition", | |
# "mlx-whisper", | |
# "pyaudio", | |
# ] | |
# /// | |
import speech_recognition as sr | |
import numpy as np |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Single File Web Component</title> | |
<style> | |
body { | |
background-color: #eee; | |
font-family: Helvetica, sans-serif; | |
} |
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 system = require('system'); | |
var page = require('webpage').create(), | |
address, output, size; | |
if (system.args.length < 2 || system.args.length > 3) { | |
console.log('Usage: rasterize.js URL filename'); | |
phantom.exit(); | |
} else { | |
console.log(system.args); | |
address = system.args[1]; |
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 cProfile, pstats, StringIO | |
pr = cProfile.Profile() | |
pr.enable() | |
# ... do something ... | |
pr.disable() | |
s = StringIO.StringIO() | |
sortby = 'cumulative' | |
ps = pstats.Stats(pr, stream=s).sort_stats(sortby) |
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
Save the supervisord.initscript script as /etc/init.d/supervisord | |
Run /usr/sbin/update-rc.d -f supervisord defaults |
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 MySQLdb; | |
from datetime import datetime | |
import re | |
import mailbox | |
import sys | |
name = "enation" | |
threading=False | |
if len(sys.argv) > 1: |
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
/* Expanded form of a bookmarklet for extracting rev=canonical OR tinyurling a page */ | |
(function(){ | |
var url=document.location; | |
var links=document.getElementsByTagName('link'); | |
var found=0; | |
for(var i = 0, l; l = links[i]; i++) { | |
if (l.getAttribute('rev') == 'canonical' || (/alternate short/).exec(l.getAttribute('rel'))) { | |
found=l.getAttribute('href'); | |
break; | |
} |