Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Johnson nathan815

View GitHub Profile
@nathan815
nathan815 / fider.css
Last active Oct 13, 2021
Custom CSS for Fider instance for The Swan Station
View fider.css
:root {
--header-bg: #0f2413;
--header-foreground: #fff; /* #20bf20 */
--primary-color: #118311;
--primary-color-dark: #107010;
--primary-color-light: #118311;
}
#c-header {
background: var(--header-bg);
View AWX Auto Fill Survey Script
This bookmarklet will autofill all the survey fields in an AWX Launch Job Prompt in one click. It gets the values from the extra vars which are much easier to paste or edit.
Just add the `javascript:...` code as the URL in a bookmark.
@nathan815
nathan815 / Log.java
Last active Jul 11, 2021
android.util.Log class override for unit tests
View Log.java
package android.util;
public class Log {
public static int v(String tag, String msg) {
print("VERBOSE", tag, msg);
return 0;
}
public static int d(String tag, String msg) {
@nathan815
nathan815 / awx_workflow_extra_data_tooltip.js
Last active Feb 5, 2021
AWX Workflows - Add an extra_data tooltip to workflow nodes
View awx_workflow_extra_data_tooltip.js
/*
AWX Workflow extra_data tooltips
This script adds a blue circle on each node, with a hover tooltip containing the node's extra_data.
It grabs each workflow node's extra_data from the angular component scope.
*/
(function () {
const workflowChart = document.querySelector('#aw-workflow-chart-g');
if (!workflowChart) return;
const scope = angular.element(workflowChart).scope();
if (!scope) return;
@nathan815
nathan815 / aksdnsfix.sh
Last active Dec 23, 2020
AKS DNS Fix: Custom Subnet Route Table Association
View aksdnsfix.sh
AKS_RG="$1"
CLUSTER_NAME="$2"
VNET_NAME="$3"
SUBNET_NAME="$4"
LOCATION="$5"
LOCATION=${LOCATION:-"eastus"} # default to eastus
echo "AKS_RG=$AKS_RG, VNET_NAME=$VNET_NAME, SUBNET_NAME=$SUBNET_NAME"
AKS_MC_RG="MC_${AKS_RG}_${CLUSTER_NAME}_${LOCATION}"
@nathan815
nathan815 / wrapMiddleware.ts
Created Dec 5, 2020
Socket.io Express Middleware Wrapper
View wrapMiddleware.ts
function wrapMiddleware(fn: (req: Request, res: Response, next: NextFunction) => void) {
return function (socket: Socket, next: (err?: ExtendedError) => void) {
fn(socket.request as Request, {} as Response, next as NextFunction);
};
}
@nathan815
nathan815 / docker-compose.yml
Last active Dec 8, 2021
Updated docker-compose.yml for big-data-europe/docker-hadoop
View docker-compose.yml
version: "2.1"
services:
namenode:
build: ./namenode
container_name: namenode
volumes:
- hadoop_namenode:/hadoop/dfs/name
environment:
- CLUSTER_NAME=test
@nathan815
nathan815 / build.gradle
Created Jan 10, 2020
Exclude paths in jacoco
View build.gradle
jacocoTestReport {
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: [
"**/src/main/java/**",
"other/path/to/exclude"
])
}))
}
}
View DriveTrain.java
package org.usfirst.frc.team5517.robot.subsystems;
import org.usfirst.frc.team5517.robot.RobotMap;
import org.usfirst.frc.team5517.robot.commands.Drive;
import org.usfirst.frc.team5517.robot.sensors.ADXRS453Gyro;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.command.Subsystem;
/**
@nathan815
nathan815 / style.css
Created Feb 10, 2017
Fix GitHub header bar
View style.css
.header-logo-invertocat {
float: left;
margin-right: 10px;
margin-left: -2px;
color: #555;
white-space: nowrap;
}
.header-search {
float: left;