This file contains 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 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 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 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 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 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 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 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"; | |
}); |
This file contains 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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express'); | |
var http = require('http'); | |
var app = express(); | |
// all environments | |
app.use(express.favicon()); |
This file contains 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
// Generated on 2013-04-23 using generator-webapp 0.1.7 | |
'use strict'; | |
var path = require('path'); | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' | |
// use this if you want to match all subfolders: | |
// 'test/spec/**/*.js' |
NewerOlder