Skip to content

Instantly share code, notes, and snippets.

Avatar
✌️

David Pelayo davidpelayo

✌️
View GitHub Profile
@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
View agnoster.zsh-theme
# 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
@davidpelayo
davidpelayo / GithubClient.groovy
Last active September 22, 2015 08:52 — forked from kyleboon/GithubClient.groovy
Simple Github API client using Groovy RESTClient
View GithubClient.groovy
/**
* Simple Github API client that supports basic auth.
*/
class GithubClient {
String username
String password
String owner
String repository
String fetchFileContents(String filePath) {
@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
View GithubClient.groovy
//#!/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"]))