Created
January 4, 2014 19:53
-
-
Save whilp/8259830 to your computer and use it in GitHub Desktop.
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
| (require 'auth-source) | |
| (require 'url) | |
| (defun* my-gh-profile (url user) | |
| (let* ( | |
| (urlobj (url-generic-parse-url url)) | |
| (host (url-host urlobj)) | |
| (auth-info | |
| (car | |
| (auth-source-search | |
| :max 1 | |
| :host host | |
| :user user | |
| :port 443 | |
| :create nil))) | |
| (token (funcall (plist-get auth-info :secret)))) | |
| (list | |
| :url url | |
| :username user | |
| :token token | |
| :remote-regexp (gh-profile-remote-regexp host)))) | |
| (setq | |
| gh-profile-default-profile "github" | |
| gh-profile-current-profile nil | |
| gh-profile-alist (list | |
| (cons "bh" (my-gh-profile "https://github.banksimple.com/api/v3" "whilp")) | |
| (cons "gh" (my-gh-profile "https://api.github.com" "whilp")) | |
| ) | |
| ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment