ffmpeg -i input.mp4 -b 1000000 output.mp4
ffmpeg -i input.m2ts -vcodec libx264 -crf 20 -acodec ac3 -vf "yadif" output.mp4
# -fobjc-arc: enables ARC | |
# -fmodules: enables modules so you can import with `@import AppKit;` | |
# -mmacosx-version-min=10.6: support older OS X versions, this might increase the binary size | |
clang main.m -fobjc-arc -fmodules -mmacosx-version-min=10.6 -o main |
# 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 | |
from struct import unpack | |
from zlib import decompress | |
import re | |
filename = '/System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/9f5862030e8f00af171924ebbc23ebfd6e91af78.asset/AssetData/Oxford Dictionary of English.dictionary/Contents/Resources/Body.data' | |
f = open(filename, 'rb') |
from ctypes import c_void_p, c_char_p, c_double, c_float, c_int, cdll, util, c_bool | |
import os | |
import time | |
# Load Objective-C runtime: | |
objc = cdll.LoadLibrary(util.find_library('objc')) | |
objc.sel_getName.restype = c_char_p | |
objc.sel_getName.argtypes = [c_void_p] | |
objc.sel_registerName.restype = c_void_p | |
objc.sel_registerName.argtypes = [c_char_p] |
Exporting password + one-time code data from iCloud Keychain is now officially supported in macOS Monterey and Safari 15 (for Monterey, Big Sur, and Catalina). You can access it in the Password Manager’s “gear” icon (System Preferences > Passwords on Monterey, and Safari > Passwords everywhere else), or via the File > Export > Passwords... menu item). You shouldn't need to hack up your own exporter anymore.
After my dad died, I wanted to be able to have access any of his online accounts going forward. My dad was a Safari user and used iCloud Keychain to sync his credentials across his devices. I don’t want to have to keep an OS X user account around just to access his accounts, so I wanted to export his credentials to a portable file.
#!/bin/bash | |
# | |
# Run this script in a folder full of ".url" files, and pipe output to an HTML file. | |
# Example: ./convert_url_files_to_bookmarks.sh > bookmarks.html | |
echo "<!DOCTYPE NETSCAPE-Bookmark-file-1>" | |
echo '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">' | |
echo '<TITLE>Bookmarks</TITLE>' | |
echo '<H1>Bookmarks</H1>' | |
echo '<DL><p>' |
javascript:window.location='onewriter://x-callback-url/replace-selection?text='+encodeURIComponent('%5B%5D('+location.href+'%20%5C''+document.title+'%5C')') |
#!/usr/bin/ruby | |
module Bytes | |
def to_human(n,fmt=false) | |
count = 0 | |
formats = %w(B KB MB GB TB PB EB ZB YB) | |
while (fmt || n >= 1024) && count < 8 | |
n /= 1024.0 |
/* ------------------------------------------------- | |
The style sheet is from the subreddit at | |
http://www.reddit.com/r/GetMotivated | |
The reason the stylesheet has been copied | |
is because it seems to follow for writing | |
css. For example defining the colors at the start. | |
Another reason is to see how an image can be |
#!/bin/bash | |
url=http://redefininggod.com | |
webarchive=https://web.archive.org | |
wget="wget -e robots=off -nv" | |
tab="$(printf '\t')" | |
additional_url=url.list | |
# Construct listing.txt from url.list | |
# The list of archived pages, including some wildcard url |