I hereby claim:
- I am dvdbng on github.
- I am bengoa (https://keybase.io/bengoa) on keybase.
- I have a public key whose fingerprint is 96A5 554D 451B 813E 0642 F48B 8C88 3382 7C5F 60F4
To claim this, I am signing this object:
| #!/usr/bin/env python3 | |
| """ | |
| Usage: subscene-dl <subscene url> > file.srt | |
| Example: | |
| subscene-dl https://subscene.com/subtitles/mr-mercedes-second-season/english/1864622 > Mr.Mercedes.S02E09.WEBRip.x264-ION10.srt | |
| """ | |
| from lxml import html | |
| import requests |
I hereby claim:
To claim this, I am signing this object:
| /* | |
| Note: Due to CORS, this only works in chromium with disabled web security. | |
| Start chrome like this: chromium-browser --disable-web-security --user-data-dir=/tmp/chrometmp | |
| Load the page you want and paste the script in the web console. | |
| This will save a snapshoot of the DOM and inline all CSS and images so that usually the page will | |
| look exactly the same, but there is no javascript in the page. | |
| Note that the generated file can be large in size, because the same URL might be inlined more than once. | |
| */ | |
| var CSS_IMPORT = /@import\s*["']([^"']+)["']/g |
| import requests | |
| import os | |
| import time | |
| import base64 | |
| import hmac | |
| import hashlib | |
| from decimal import Decimal, getcontext | |
| API_URL = 'https://api.pro.coinbase.com' |
| mkdir ~/vim | |
| cd ~/vim | |
| # Staically linked vim version compiled from https://github.com/ericpruitt/static-vim | |
| # Compiled on Jul 20 2017 | |
| curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz | |
| export VIMRUNTIME="$HOME/vim/runtime" | |
| export PATH="$HOME/vim:$PATH" | |
| cd - |
| # bench_pg_array.py - benchmark postgresql array vs. join performance | |
| """ | |
| Replicate http://shon.github.io/2015/12/21/postgres_array_performance.html | |
| with proper join table indexes (uniqueness constraints) using sqlalchemy. | |
| $ python -i bench_pg_array.py | |
| >>> setup() | |
| $ python -m timeit -s "import bench_pg_array" "bench_pg_array.test_join()" |
| intersection = (lst) -> | |
| types = lst.map((x)-> typeof x) | |
| if types.some((t) -> t != types[0]) | |
| return null | |
| switch types[0] | |
| when "object" | |
| res = {} | |
| Object.keys(lst[0]).forEach (k) -> | |
| if lst.every((o) -> k of o) |
| intersection = (lst) -> | |
| types = lst.map((x)-> typeof x) | |
| if types.some((t) -> t != types[0]) | |
| return null | |
| switch types[0] | |
| when "object" | |
| res = {} | |
| Object.keys(lst[0]).forEach (k) -> | |
| if lst.every((o) -> k of o) |
| // ==UserScript== | |
| // @name Open PR Link | |
| // @namespace ghprlink | |
| // @description Show a open PR link when an issue has label "3 - code review" | |
| // @include https://github.com/* | |
| // @version 1 | |
| // @grant none | |
| // ==/UserScript== | |
| function addOpenPRLinks(){ |
| import os | |
| import re | |
| def zsh_to_fish(cmd): | |
| return (cmd.replace('&&', '; and ') | |
| .replace('||', '; or ')) | |
| def is_valid_fish(cmd): |