I hereby claim:
- I am kasimte on github.
- I am kasim (https://keybase.io/kasim) on keybase.
- I have a public key ASAKS4iJvRsfmLAjWOebG4mjHFY3XQTMe86umzEfb7niJQo
To claim this, I am signing this object:
#!/bin/sh | |
## A little script to make it easier to launch DiffMerge from the command line. | |
## Install this script into a folder in your path, such as /usr/bin or /usr/local/bin. | |
## | |
## Version 3.3.0.1001 | |
## Copyright (C) 2003-2009 SourceGear LLC. All Rights Reserved. | |
############################################################################## | |
## Change DIFFMERGE_PATH to point to where you installed DiffMerge |
class Config: | |
def __init__(self, a, b): | |
self.a = a | |
self.b = b | |
config = Config(1, 2) | |
script = "./my_script.py" | |
# note the "" around config | |
command = "python {script} \"{config}\"".format(script=script, config=vars(config)) | |
os.system(command) |
def latest_match_from(path, match): | |
# read the modification time | |
mtime = lambda f: os.stat(os.path.join(path, f)).st_mtime | |
# read all files from path and sort based on modification time | |
files = list(sorted(os.listdir(path), key=mtime)) | |
# filter based on match | |
matches = [a for a in files if match in a] | |
# return the full path of the most recent match | |
return os.path.join(path, matches[-1]) |
# output.py (separate file) | |
print(37.234) | |
# capture_output_from_script.py | |
import subprocess | |
# run output.py as subprocess and capture output, format it, convert to float, and print | |
x = float(subprocess.check_output('python output.py', shell=True, text=True).strip()) | |
print(x) |
import WebKit | |
import RxSwift | |
import RxCocoa | |
public extension Reactive where Base: WKScriptMessageHandler { | |
func didReceiveMessage() -> Observable<(WKUserContentController, WKScriptMessage)> { | |
return self.methodInvoked(#selector(Base.userContentController)) | |
.map { args in | |
guard args.count == 2, | |
let controller = args[0] as? WKUserContentController, |
extension Array where Element: Encodable { | |
/// - Returns: An array having removed any element of the array which is not encodable itself. | |
func filterUncodable() -> [Element] { | |
return self.filter { (el: Element) -> Bool in | |
let encoded = try? JSONEncoder().encode(el) | |
return encoded != nil ? true : false | |
} | |
} | |
} |
[diff] | |
tool = diffmerge | |
[difftool "diffmerge"] | |
cmd = diffmerge \"$LOCAL\" \"$REMOTE\" | |
[merge] | |
tool = diffmerge | |
[mergetool "diffmerge"] | |
cmd = "diffmerge --merge --result=\"$MERGED\" \"$LOCAL\" \"$(if test -f \"$BASE\"; then echo \"$BASE\"; else echo \"$LOCAL\"; fi)\" \"$REMOTE\"" | |
trustExitCode = true |
I hereby claim:
To claim this, I am signing this object:
<!-- From https://github.com/fastai/fast_template/blob/6f72d2957a4e302e437f4437dd6a1e5a1f14274a/_includes/head.html --> | |
{% if site.use_mathjax %} | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" integrity="sha384-zB1R0rpPzHqg7Kpt0Aljp8JPLqbXI3bhnPWROx27a9N0Ll6ZP/+DiW/UqRcLbRjq" crossorigin="anonymous"> | |
<script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> | |
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.js" integrity="sha384-y23I5Q6l+B6vatafAwxRu/0oK/79VlbSz7Q9aiSZUvyWYIYsd+qj+o24G5ZU2zJz" crossorigin="anonymous"></script> | |
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"></script> | |
<script> | |
document.addEventListener("DOMContentLoaded", function() { | |
renderMathInElement( document.body |
# Usage: | |
# | |
# 1) cd <my-directory-with-mov-files> | |
# 2) ruby convert-mov-to-mp4.rb | |
# | |
mov_files = Dir[Dir.pwd() + "/*.MOV"] | |
mov_files.each do |file| | |
puts "Processing file: #{ file }" | |
# extract the basename for renaming |