Skip to content

Instantly share code, notes, and snippets.

View davidpelayo's full-sized avatar
✌️

David Pelayo davidpelayo

✌️
View GitHub Profile
@davidpelayo
davidpelayo / GithubClient.groovy
Last active September 22, 2015 08:03 — forked from joshareed/GithubClient.groovy
Fetch list of issues from Github and draft an email
//#!/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"]))
@davidpelayo
davidpelayo / GithubClient.groovy
Last active September 22, 2015 08:52
Simple Github API client using Groovy RESTClient
/**
* Simple Github API client that supports basic auth.
*/
class GithubClient {
String username
String password
String owner
String repository
String fetchFileContents(String filePath) {
@davidpelayo
davidpelayo / agnoster.zsh-theme
Created November 29, 2017 07:53 — forked from elijahmanor/agnoster.zsh-theme
Custom Agnoster Zsh Theme to Add Node & Npm Versions
# 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