Skip to content

Instantly share code, notes, and snippets.

View Iboatwright's full-sized avatar

Ivan Boatwright Iboatwright

View GitHub Profile
@Iboatwright
Iboatwright / doit_infinity.groovy
Created March 10, 2020 15:05
groovy method for handling 1 or more java.lang.Processes with pipes and error checking
// This was designed to work in Jenkins script console...
def proc(String string) { string.execute() }
def lsa(String path){ proc("ls -lA ${path}") }
def doit;
doit = { java.lang.Process[] p ->
if (!p.size()) { return "[Error] You didn't supply an it to do." }
if (p.size() == 1) {
p[0].waitFor()
return (p[0].exitValue())? println p[0].err.text : println p[0].text;
@Iboatwright
Iboatwright / README.md
Last active January 17, 2020 17:57
splunk education portal UI modification via javascript bookmarklet

jwplayer_rules bookmarklet

I didn't like the video UI for the Splunk Education page. So I added easier controls for video zooming and playback speed. I also adding easy download links for the closed caption files. I wrote this for use in Chrome. I'm not sure if it'll work in Firefox or any other browser for that matter.

why 3 files?

I think chrome has a 2 MB limit for urls and I assume that'll apply to bookmarks too. Which means the base version of this should work if you prepend it with javascript:. I didn't bother looking that up until after I'd already finished the bm version. Go me.

optional

The changes from jwplayer_rules.js file to jwplayer_rules.min.js are done by hand. I couldn't find a minimizer that did what I wanted and it was faster to do it by hand.

@Iboatwright
Iboatwright / README.md
Last active June 20, 2022 20:52
Various Jenkins Groovy shell scripts and scraps

The Jenkins server these are written for hasn't (can't) been updated since 2017. So some commands are probably deprecated in current versions.

These scripts are all written to run from the /jenkins/script Script Console.

@Iboatwright
Iboatwright / README.md
Created October 25, 2019 18:07 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
@Iboatwright
Iboatwright / HW4.java
Created April 27, 2018 21:23
HW4 done with as much functional programming as I could get away with.
/**
* FileName: FileIO.java
* Author: 5153
* Created: December 4, 2017
* Last Modified: December 11, 2017
*/
import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;
@Iboatwright
Iboatwright / TickTockTimer.js
Created April 22, 2018 15:48
A simple React composition to explore how functions and classes work.
function Tick() {
return (
<div>
<h1>Hello, world!</h1>
<h2>It is {new Date().toLocaleTimeString()}.</h2>
</div>
);
}
class Tock extends React.Component {
@Iboatwright
Iboatwright / Rotate.java
Created February 25, 2018 21:40
Java snippet for displaying 2D arrays and for rotating them.
/*
This is for displaying 2D arrays and for rotating them.
*/
public class Rotate {
public static void parr(int[][] arr){
System.out.println();
for (int i = 0; i < arr.length; i++) {
for (int j:arr[i]) {
System.out.printf("%-3d ", j);
}
@Iboatwright
Iboatwright / midterm_3_prep.md
Last active December 20, 2017 20:01
COP3003 Exam 3 study notes

COP3003 Exam 3 Study Note

Topics covered

Ordered by date introduced 3. chapter 20: Generic Classes and Methods

  • There is nothing in the study guide directly on generics
  • Likely it will be a part of something else, but not the focus
  1. chapter 16: Collections (Interface Collections, Class Collections)
  • Lists - Ordered by insertion, duplicates allowed
  • Sets - not ordered, only uniques
  • Maps - not ordered, key-value association
void fun(int[][4], int, int, int&, int&);
int main(){
int arr[][4] = {{1,2,-3,4},{5,6,-3}};
int row, col;
fun(arr, sizeof(arr)/sizeof(int), sizeof(arr[0])/sizeof(int), row, col);
return 0;
}
#include <iostream>
#include <unistd.h>
using namespace std;
int main(int argc, char* argv[]) {
int pid = getpid(); // parent's process id
int numberOfChildren = 4;