This file contains hidden or 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
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
This file contains hidden or 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
# coding=utf-8 | |
import json | |
import urllib2 | |
from cookielib import CookieJar | |
hb_url = 'https://httpbin.org/basic-auth/user/pass' | |
req = urllib2.Request(hb_url) | |
password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() |
This file contains hidden or 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
(defun get-repo-url (arg) | |
(let* ((remote (if arg "upstream" (nth 2 (s-split "/" (magit-get-tracked-ref))))) | |
(remote-url (magit-get "remote" remote "url")) | |
(fragments (s-split "[:/@]/?/?" (s-chop-suffix ".git" remote-url)))) | |
(concat "http://" (s-join "/" (cdr fragments))))) | |
(defun open-in-repo (arg) | |
(interactive "P") | |
(let* ((url (get-repo-url arg)) | |
(branch (if arg "master" (magit-get-current-branch))) |