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 Foundation | |
import CoreImage | |
let arguments = CommandLine.arguments | |
if arguments.count < 2 { | |
fatalError("Usage: \(arguments[0]) filename [filename...]") | |
} | |
let context = CIContext() | |
guard let detector = CIDetector(ofType: CIDetectorTypeQRCode, context: context) else { | |
fatalError("Unable to initialize detector") |
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
roland@MacBook-Air:~/Documents/tiktok/com.zhiliaoapp.musically-272016.ipa/Payload/TikTok.app$ otool -L TikTok | |
TikTok: | |
/System/Library/Frameworks/JavaScriptCore.framework/JavaScriptCore (compatibility version 1.0.0, current version 613.2.6) | |
@rpath/MusicallyCore.framework/MusicallyCore (compatibility version 0.0.0, current version 0.0.0) | |
/System/Library/Frameworks/Intents.framework/Intents (compatibility version 1.0.0, current version 1.0.0, weak) | |
/System/Library/Frameworks/WidgetKit.framework/WidgetKit (compatibility version 1.0.0, current version 181.16.0, weak) | |
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.25.0) | |
/System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 1860.0.0) | |
/System/Library/Frameworks/UIKit.framework/UIKit (compatibility version 1.0.0, current version 5610.0.0) | |
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) |
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/bin/env bash | |
branch_file="$(mktemp)" | |
git branch -l --format '%(refname:lstrip=2)' > "$branch_file" | |
git reflog --format='%D' | sed -e 's/, /\n/g' | awk '$0 && !x[$0]++ {print}' | grep -x -F -f "$branch_file" | head -n 10 | tac | |
rm "$branch_file" |
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/bin/env ruby | |
class WordMarkov | |
def initialize(data=[]) | |
@nexts = {} | |
@initials = [] | |
data.each do |word| | |
chars = word.split('') | |
@initials << chars[0..1] | |
chars[0..-3].each_with_index do |char, i| |
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 glob import glob | |
from lxml import etree | |
def xpath(el, path): | |
return el.xpath(path, namespaces={ | |
'kml': 'http://www.opengis.net/kml/2.2', | |
'gx': 'http://www.google.com/kml/ext/2.2' | |
}) |
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
# mix two audio streams together: | |
youtube-dl "https://www.youtube.com/watch?v=c38HJR-9vhU" -f best -o burnafterreading.mp4 | |
youtube-dl "https://www.youtube.com/watch?v=Pqh63ca__mM" -f best -o chromatica.mp4 | |
ffmpeg \ | |
-ss 77.2 \ # skip first 77.2 seconds of first input | |
-i burnafterreading.mp4 \ | |
-i chromatica.mp4 \ | |
-filter_complex "[0:1][1:1] amix=inputs=2:weights=2 1" \ # mix track 1 (audio) of inputs 0 and 1, make audio 0 twice as loud as 1 | |
-map 0:0 \ # use track 0 (video) from input 0 | |
-c:a aac -strict -2 \ # don't think this is necessary, default encoder settings should be fine |
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/bin/env python3 | |
from OpenSSL import crypto, SSL | |
from typing import List, Optional | |
import sys | |
import os | |
import errno | |
def get_or_make_key(cn: str) -> crypto.PKey: |
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
#!/bin/bash | |
read -r win_found <<<$(wmctrl -l -p | awk '{print $1,$3}' | while read -r wins; do ps -o command= -p "${wins/0x* /}" | grep -q gnome-terminal && echo "${wins/ */}" && break; done) | |
if [ -z "$win_found" ]; then | |
gnome-terminal | |
else | |
wmctrl -i -a $win_found | |
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
SELECT ?ingredient ?ingredientLabel (GROUP_CONCAT(DISTINCT ?sandwichLabel; SEPARATOR = ", ") AS ?sandwiches) WHERE { | |
?sandwich ((wdt:P31?)/(wdt:P279*)) wd:Q28803; | |
wdt:P527 ?ingredient. | |
MINUS { ?ingredient (wdt:P279*) wd:Q7802. } | |
SERVICE wikibase:label { | |
bd:serviceParam wikibase:language "en", "fr". | |
?sandwich rdfs:label ?sandwichLabel. | |
?ingredient rdfs:label ?ingredientLabel. | |
} | |
} |
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
SELECT | |
?film | |
?title | |
?directors | |
?year | |
WHERE | |
{ | |
SELECT | |
?film | |
?title |
NewerOlder