Skip to content

Instantly share code, notes, and snippets.

View glowinthedark's full-sized avatar

glowinthedark glowinthedark

  • URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
  • HTTPError: HTTP Error 403: Forbidden
View GitHub Profile
@glowinthedark
glowinthedark / whisper-transcribe.bash
Created November 14, 2022 13:10 — forked from DaniruKun/whisper-transcribe.bash
Transcribe (and translate) any VOD (e.g. from Youtube) using Whisper from OpenAI and embed subtitles!
#!/usr/bin/env bash
# Small shell script to more easily automatically download and transcribe live stream VODs.
# This uses YT-DLP, ffmpeg and the CPP version of Whisper: https://github.com/ggerganov/whisper.cpp
# Use `./transcribe-vod help` to print help info.
# MIT License
# Copyright (c) 2022 Daniils Petrovs
@glowinthedark
glowinthedark / python_request_create_gist.py
Created November 11, 2022 22:57 — forked from joshisumit/python_request_create_gist.py
Create GIST from your python code with python requests module and OAuth token.
'''
HTTP Reuests has following parameters:
1)Request URL
2)Header Fields
3)Parameter
4)Request body
'''
#!/usr/bin/env python
import requests
@glowinthedark
glowinthedark / lxml_examples.py
Created October 27, 2022 14:51 — forked from IanHopkinson/lxml_examples.py
Examples of xpath queries using lxml in python
#!/usr/bin/env python
# encoding: utf-8
import lxml.etree
import lxml.html
import requests
xml_sample = """<?xml version="1.0" encoding="UTF-8"?>
<foo:Results xmlns:foo="http://www.foo.com" xmlns="http://www.bah.com">
<foo:Recordset setCount="2">
@glowinthedark
glowinthedark / README.md
Last active September 23, 2022 14:04 — forked from cuth/README.md
Font Size Bookmarklet

Font Size Bookmarklet

Code

javascript:(function(){'use strict';var getFontSize=function(el){return parseFloat(getComputedStyle(el,null)['font-size']);};document.addEventListener('wheel',function(e){if(!e.altKey)return;e.preventDefault();var el=e.target;var parent=el.parentElement;var size=getFontSize(el);while(parent&&size===getFontSize(parent)){el.style.fontSize='inherit';el=parent;parent=parent.parentElement;}
if(e.wheelDelta>0){size+=1;}else{size-=1;}
console.log(size);el.style.fontSize=size+'px';el.style.lineHeight='1.2em';});}());
@glowinthedark
glowinthedark / 0dedict.py
Last active April 15, 2022 04:37 — forked from josephg/0dedict.py
Apple dictionaries
#!/usr/bin/env python3
# -*- coding: ascii -*-
# Thanks to commenters for providing the base of this much nicer implementation!
# Save and run with $ python 0dedict.py
# You may need to hunt down the dictionary files yourself and change the awful path string below.
# This works for me on MacOS 10.14 Mohave
# /System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/0cab8989af7642f18332cfdc038d97017d28586a.asset/AssetData/Spanish - English.dictionary/Contents/Resources/Body.data
import sys
@glowinthedark
glowinthedark / get_gists.py
Last active January 28, 2023 16:58 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
#!/usr/bin/env python3
#
# download all gists for a user, pass github user as first arg
# if the gists have already been downloaded before then update them
import json
import os
import re
import requests
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ACE Editor: submit, beautify and minify</title>
<style type="text/css" media="screen">
#ace_js, #ace_css {
width: 95%;
height: 15em;
border: 1px solid silver;
@glowinthedark
glowinthedark / adb.sh
Created August 17, 2020 13:39 — forked from sofaking/adb.sh
Get battery level via adb
adb shell dumpsys battery | grep level
@glowinthedark
glowinthedark / gist:8d3b72a3e2a3657d5b4dde63dba6faf0
Created August 3, 2020 11:14 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@glowinthedark
glowinthedark / exmp3.py
Created August 2, 2020 16:38 — forked from RavuAlHemio/exmp3.py
find and extract MP3 files from a binary file
#!/usr/bin/env python3
from math import floor
import struct
mp3_bit_rates = {
0b0001: 32000,
0b0010: 40000,
0b0011: 48000,
0b0100: 56000,
0b0101: 64000,