Skip to content

Instantly share code, notes, and snippets.

View johnrc's full-sized avatar

John Cragun johnrc

View GitHub Profile
@johnrc
johnrc / jenkins-merge-pr.sh
Created June 19, 2017 17:02 — forked from oleg-nenashev/jenkins-merge-pr.sh
Simple git merge with squash for Jenkins repos
#!/bin/bash -ex
REPO_NAME=${PWD##*/}
TARGET_ORG="jenkinsci"
#TODO: fetch from GitHib API
#TODO: if no, process parameters correctly
GITHUB_PR_NUMBER=${1}
FROM_USER=${2}
BRANCH=${3}
@johnrc
johnrc / main.go
Created March 30, 2020 23:05
Print pdf from website with Golang
func ExamplePrintToPDF() {
ctx, cancel := chromedp.NewContext(context.Background())
defer cancel()
var buf []byte
if err := chromedp.Run(ctx,
chromedp.Navigate(`https://godoc.org/github.com/chromedp/chromedp`),
chromedp.ActionFunc(func(ctx context.Context) error {
var err error
buf, _, err = page.PrintToPDF().
@johnrc
johnrc / export-cassandra.sh
Created March 30, 2020 23:06
Simple script to export Cassandra table to csv file
#!/bin/bash
table=$1
filename=$2
cqlsh -e "COPY $table TO './$filename' WITH HEADER = true;"