Skip to content

Instantly share code, notes, and snippets.

@MawKKe
MawKKe / split_ffmpeg.py
Last active August 7, 2021 21:50
MOVED TO: https://github.com/MawKKe/audiobook-split-ffmpeg | Split audio file with ffmpeg based on chapter metadata
#!/usr/bin/env python3
import sys
import os
import re
import subprocess as sub
import argparse
import tempfile
import json
from concurrent.futures import ThreadPoolExecutor, as_completed
"""
Use custom fonts in the editor
Usage: https://forum.omz-software.com/topic/3419/share-code-custom-editor-font
"""
__author__ = "Lukas Kollmer<lukas.kollmer@gmail.com>"
__copyright__ = "Copyright (c) 2016 Lukas Kollmer<lukas.kollmer@gmail.com>"
from objc_util import *
@twostraws
twostraws / TopSekritPokemonGoSourceCode.swift
Created July 17, 2016 21:15
Totally Top Sekrit Pokémon Go Source Code
//
// PokemonGoViewController.swift
// Totally Top Sekrit Pokémon Go Source Code
//
// Created by Niantic on 07/01/2016.
// Copyright © 2016 Niantic rights reserved.
//
import UIKit
@howientc
howientc / xiobase.py
Created June 18, 2016 00:40
Gets the base of XIOs on C.H.I.P. computers. Currently on 4.3, it's 408, and on 4.4 it's 1016. This calculates it dynamically
import os
GPIO_PATH = "/sys/class/gpio" # The root of the GPIO directories
EXPANDER = "pcf8574a" # This is the expander that is used on CHIP for the XIOs
def get_xio_base():
'''
Determines the base of the XIOs on the system by iterating through the /sys/class/gpio
directory and looking for the expander that is used. It then looks for the
"base" file and returns its contents as an integer
@omz
omz / Add Playground Page.py
Created June 17, 2016 00:27
Add Playground Page.py
#! python3
# Share sheet extension script for adding new pages to Swift Playgrounds (experimental)
# HOW TO USE:
# 1. Add this script as a shortcut to the Pythonista extension (either from Pythonista's settings or the share sheet extension itself)
# 2. Tap the "Share" button in the Playground app's library.
# 3. Select the playground that you want to add a page to
# 4. Select "Run Pythonista Script" in the share sheet
# 5. Run this script, to select the chapter and page title.
@BenjyWiener
BenjyWiener / ReplayKit.py
Last active September 7, 2017 04:34
ReplayKit.py
# coding: utf-8
from objc_util import *
from Foundation import NSBundle
NSBundle.bundleWithPath_('/System/Library/Frameworks/ReplayKit.framework').load()
RPScreenRecorder = ObjCClass('RPScreenRecorder')
@controversial
controversial / Foundation.py
Created February 6, 2016 20:11
Foundation.py
classes=['NSAKDeserializer', 'NSAKDeserializerStream', 'NSAKSerializer', 'NSAKSerializerStream', 'NSAbstractLayoutGuide', 'NSAddressCheckingResult', 'NSAffineTransform', 'NSArchiver', 'NSArrayChange', 'NSArrayChanges', 'NSAssertionHandler', 'NSAttributedString', 'NSAutoreleasePool', 'NSAutoresizingMaskLayoutConstraint', 'NSBigMutableString', 'NSBlockExpression', 'NSBlockOperation', 'NSBlockPredicate', 'NSBoundKeyPath', 'NSBundle', 'NSBundleResourceRequest', 'NSByteCountFormatter', 'NSCachedURLResponse', 'NSCalendarDate', 'NSCharacterSet', 'NSCheapMutableString', 'NSCoder', 'NSComparisonPredicate', 'NSComparisonPredicateOperator', 'NSComplexOrthography', 'NSComplexRegularExpressionCheckingResult', 'NSCompoundPredicate', 'NSCompoundPredicateOperator', 'NSConcreteAttributedString', 'NSConcreteMutableAttributedString', 'NSConcreteValue', 'NSCondition', 'NSConditionLock', 'NSConstantString', 'NSConstantValueExpression', 'NSContentSizeLayoutConstraint', 'NSCorrectionCheckingResult', 'NSCountedSet', 'NSDashCheckingR
@omz
omz / ShortcutGenerator.py
Created December 9, 2013 11:01
ShortcutGenerator
# This script adds a "Webclip" shortcut to your homescreen.
# The shortcut can be used to open a web page in full-screen mode,
# or to launch a custom URL (e.g. a third-party app).
# You'll be asked for a title, a URL, and an icon (from your camera roll)
import plistlib
import BaseHTTPServer
import webbrowser
import uuid
from io import BytesIO
@BrettBukowski
BrettBukowski / bookmarklet.js
Created March 7, 2013 14:21
Fine-tune the playback speed on Vimeo and Youtube's HTML5 videos
javascript:!function(a){function g(a,b){for(var c in b)b.hasOwnProperty(c)&&(a.style[c]=b[c])}var b=a.querySelector("video"),c=a.createElement("input"),d=a.createElement("label"),e=a.createElement("div"),f;d.innerHTML='<span class="asdf">1x</span>',g(d,{color:"#EEE",fontSize:"11px"}),c.type="range",c.max=4,c.min=.1,c.value=1,c.step=.1,g(c,{verticalAlign:"middle",webkitAppearance:"slider-horizontal",mozAppearance:"slider-horizontal"}),d.appendChild(c),g(e,{marginTop:"3px",position:"absolute",zIndex:1e3}),e.appendChild(d),(f=a.querySelector(".html5-player-chrome"))?(f.appendChild(e),g(e,{left:"35%"})):b.parentNode.insertBefore(e,b),c.addEventListener("change",function(a){var c=a.target.value;b.playbackRate=c,d.querySelector(".asdf").innerHTML=c+"x"})}(document);