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
# vim:ft=zsh ts=2 sw=2 sts=2 | |
# | |
# agnoster's Theme - https://gist.github.com/3712874 | |
# A Powerline-inspired theme for ZSH | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need a | |
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts). | |
# Make sure you have a recent version: the code points that Powerline |
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
/** | |
* Simple Github API client that supports basic auth. | |
*/ | |
class GithubClient { | |
String username | |
String password | |
String owner | |
String repository | |
String fetchFileContents(String filePath) { |
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 groovy | |
import groovy.json.JsonSlurper | |
import java.text.SimpleDateFormat | |
// fetches a Github API URL and parses the result as JSON | |
def fetch(addr, params = [:]) { | |
def auth = "<personal api token>" | |
def json = new JsonSlurper() | |
return json.parse(addr.toURL().newReader(requestProperties: ["Authorization": "token ${auth}".toString(), "Accept": "application/json"])) |