Skip to content

Instantly share code, notes, and snippets.

View ChadRehmKineticData's full-sized avatar

ChadRehmKineticData

View GitHub Profile
@ChadRehmKineticData
ChadRehmKineticData / runner.rb
Last active April 2, 2019 15:03
Peripheral repo refactor
require 'csv'
require 'fileutils'
require 'open3'
INPUT_FILE = 'peripheral-input.csv'
GIT_CLONE_LOC = 'https://github.com/kineticdata'
CLONE_STORAGE_DIR_NAME = 'clone-storage'
PERIPH_STORAGE_DIR_NAME = 'peripherial-storage'
REPO_PRIFIX = 'peripherals-'
LOG_FILE = 'log.txt'
@ChadRehmKineticData
ChadRehmKineticData / Catalog
Created February 21, 2019 14:54
SAIC Training
import React, { Fragment } from 'react';
import { KappLink as Link, PageTitle } from 'common';
import { CatalogSearchContainer } from '../shared/CatalogSearchContainer';
import { CategoryCard } from '../shared/CategoryCard';
import { ServiceCard } from '../shared/ServiceCard';
import { RequestCard, IntegrationCard } from '../shared/RequestCard';
import { getSubmissionPath } from '../../utils';
import { I18n } from '../../../../app/src/I18nProvider';
export const Catalog = ({
@ChadRehmKineticData
ChadRehmKineticData / gist:a9e282198a96078c815b13036d4b8897
Created February 19, 2019 15:26
Password scan of task handlers
require 'json'
begin
file = File.open("./output", "w")
file.write("handler,host,password,api_server,api_password,server,password,smtp_server,smtp_password")
file.puts()
shas = `git log --pretty=format:"%h"`
shas.split("\n").each do |sha|
`git checkout #{sha}`
@ChadRehmKineticData
ChadRehmKineticData / index.js
Last active January 14, 2019 21:28
Try this to begin with. This will replace lines 228 - 277 (I might have an older set of the code so the number could be off). SidebarNavigation.js will need to be modified to pass the form object in and line 63 in SidebarNavigation will need to be modified to call checkEvaluator. This is pseudo code, but should be close.
checkEvaluator(form) {
/**
* getValue - return the value for the given feild
*
* @param {string} name of field on form
* @return {string} if the field doesn't esist a false is returned
*/
const getValue = fieldName => {
if (form.select(`field[${fieldName}]`)) {
return form.select(`field[${fieldName}]`).value();
{
'info' => {
'username' => '',
'password' => '',
'enable_debug_logging' => 'Yes'
},
'parameters' => {
'action' => 'get_notification_reports_op',
'xml' =>
'<root>
export const handleSort = ({ rows, setRows, resetOffset, setSort }) => (
sortColumn,
sortDirection,
) => {
setSort({ column: sortColumn, direction: sortDirection });
resetOffset();
/**
* Some columns that are sorted on return an object and not a string; this is result of the date-grid library.
* If the sortProperty key has been added to the object then the sort function will use that property to sort on.
*/
@ChadRehmKineticData
ChadRehmKineticData / Manage CCO CMO
Created November 2, 2018 14:48
Build CCO CMO Table in DataViewer refactored load event
global.lastUpdate = "";
global.lookupData = "";
$("#cco-cmo-messages").text("");
searchConfig = typeof searchConfig == 'undefined' ? {} : searchConfig;
searchConfig.ccoLookupTable = {
resource: {
name: 'CCO CMO Details'
},
resultsContainer:
@ChadRehmKineticData
ChadRehmKineticData / gist:125c9390c27ce1612c1d72bfd95e085d
Created October 2, 2018 17:01
Ruby script to export handlers, unzip and look for a vendor conflict.
# Add each of the gems to the load path (so that ruby/rubygems is not necessary to run this script)
$:.unshift File.dirname(__FILE__)
Dir[File.join(File.dirname(__FILE__), 'vendor', 'gems', '*', 'lib')].sort.each do |libdir|
$:.unshift libdir
end
# Require gems
require 'zip'
# # Require the Kinetic SDK from the vendor directory
@ChadRehmKineticData
ChadRehmKineticData / Bulk Import actions
Created May 16, 2018 15:37
A few of the actions used in the bulk import component.
responceHandler = arr => {
if (arr.length > 0) {
this.post(arr);
} else {
setTimeout(() => this.fetch(), 3000);
}
};
post = ([head, ...tail]) => {
if (head.id) {
import { fromJS } from 'immutable';
export const types = {
SET_ROWS: '@aegon/catalog/SET_ROWS',
SET_PAGINATION: '@aegon/catalog/SET_PAGINATION',
SET_OFFSET: '@aegon/catalog/SET_OFFSET',
RESET_ROWS: '@aegon/catalog/RESET_ROWS',
RESET_OFFSET: '@aegon/catalog/RESET_OFFSET',
RESET_COMPLETE: '@aegon/catalog/RESET_COMPLETE',
};