This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function convert(filename) { | |
if (!fs.existsSync(filename)) { | |
debug && log(`File ${filename} does not exist`) | |
} | |
const headerElements = ['Group Name', 'Project Name', 'Scanner Name', 'Status', 'Vulnerability', 'Details', 'Additional Info', 'Severity', 'CVE', 'CWE']; | |
const rows = [headerElements.join(',')]; | |
const contents = JSON.parse(fs.readFileSync(filename, { encoding: 'utf-8' })); | |
contents.forEach((item) => { | |
item.vulnerabilities.forEach((vulnerability, i) => { | |
const { identifiers, name, severityWithCritical } = vulnerability; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In ActivityTypeForm.tsx | |
if (activityType === ActivityType.Mkt) { | |
return queryAndRenderActivityForm<GetActivityMarketQuery>({ | |
activityQuery: GetActivityMarketDocument, | |
mutationDocument: SaveActivityMarketDocument, | |
queryVariables: activityId ? { id: activityId } : undefined, | |
onSaved, | |
onError, | |
Component: ActivityFormMarket, | |
mapInitialValues: (data) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRestAPI } from './hooks/useRestAPI'; | |
export function ComponentWithFetch() { | |
const result = useRestAPI<DataShape>({ url }); | |
const { loading, error, data } = result; | |
if (loading) { | |
return <Loading />; | |
} | |
if (error) { | |
return <Error />; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TaylorMade extends React.Component { | |
myCounter = null; | |
shouldComponentUpdate() { | |
if (this.myCounter) { | |
console.log('Bomb.com, I have a counter!'); | |
} | |
return true; | |
} | |
render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const fs = require('fs'); | |
// Generates now.json | |
// Writes a now config for static site copying .env to now.json | |
function main() { | |
const baseDir = path.join(__dirname, '../'); | |
const envFile = fs.readFileSync(path.join(baseDir, '.env')); | |
const envLines = envFile.toString().split('\n'); | |
const nowConfig = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int wean_dates_size = bgi->wean_dates.size(); | |
if (wean_dates_size > 0) { | |
pigknows::Date wean_date; | |
pigknows::DoubleCell dateTotals; | |
// Get a baseline time (date does not matter as since it will be used ) | |
struct std::tm baseTime = {0,0,0,27,9,82}; /* October 27, 1982 (Zachs bday :) */ | |
std::time_t x = std::mktime(&baseTime); | |
for(int i=0; i< wean_dates_size; ++i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var total = 0; | |
$('.invbody-items').find('.quantity').each(function (i, item) { | |
var me = $(item).text().trim(); | |
me = parseFloat(me, 10); | |
if (me) { total += me; } | |
}); | |
console.log('Total Hours:', total); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Hack to make CollectionFS work with FlowRouter. | |
if (Meteor.isServer) { | |
let originalFind = Collections.Media.find; | |
let originalFindOne = Collections.Media.findOne; | |
Collections.Media.__proto__.findOne = function (selector, options) { | |
let self = this; | |
return FlowRouter.ssrContext.withValue(null, function() { | |
return originalFindOne.call(self, selector, options); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([], function(){ | |
'use strict'; | |
var MODULE = { | |
}; | |
return MODULE; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Email Addresses /// | |
var rows = $("#table_email_accts tr.dt_info_row"), | |
returnString = ""; | |
rows.each(function(i, item){ | |
var tdList = []; | |
$(item).find('td:eq(0)').each(function(s, subItem){ | |
tdList.push($(subItem).text()); | |
}); | |
returnString += tdList + "\n"; | |
}); |
NewerOlder