Skip to content

Instantly share code, notes, and snippets.

View sridharavinash's full-sized avatar
💭
🐝

Avinash Sridhar sridharavinash

💭
🐝
View GitHub Profile
@sridharavinash
sridharavinash / hexbot.sh
Last active June 13, 2019 18:45
An experiment on using the hexbot from noopschallenge, https://noopschallenge.com/challenges/hexbot
#!/bin/bash
#
# usage: ./hexbot.sh 10 rainbow
# will print the string `rainbow` on the commandline in the colors
# that the hexbot responds with.
#
# Not specifying a string will print the nyancat
# fromhex A52A2A
@sridharavinash
sridharavinash / check-run.go
Last active August 8, 2018 08:37
Check Run API example using an installed GitHub App
package main
import (
"context"
"fmt"
"net/http"
"github.com/bradleyfalzon/ghinstallation"
"github.com/google/go-github/github"
)
@sridharavinash
sridharavinash / status.sh
Last active March 30, 2017 01:25
Branch build status on command line
#!/bin/bash
#
# Export $GITHUB_TOKEN with your access token
#
function get_build_status(){
branch=$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')
repo=$(git config --get remote.origin.url | egrep -Eo '/(\w+)' | cut -d '/' -f 2)
status=$(curl -s -u "$GITHUB_TOKEN:x-oauth-basic" https://api.github.com/repos/github/$repo/commits/$branch/status | jq '.state' | tr -d '"')