Skip to content

Instantly share code, notes, and snippets.

View EricRohlfs's full-sized avatar

Eric Rohlfs EricRohlfs

View GitHub Profile
<!-- edited from original so might be some issues-->
<table id='oss_report'>
<template id="row">
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
param($path, $env)
#note: the metrics.exe is managed in the nuget package file for this project
#note: create and use a separate .sln file with only the projects that need scanning. Exclude test projects etc.
# run local command: .\"Deployment Scripts\generate_code_metrics.ps1" "E:\code\ESSO"
$metrics_exe = "$path\packages\Microsoft.CodeAnalysis.Metrics.3.3.0\Metrics\Metrics.exe"
$sln_file = "$path\CodeMetrics.sln"
$metricsHtmlFile = "$path\codeMetrics.html"
<html>
<head>
</head>
<body>
<h1></h1>
<div>My Friends</div>
<ul></ul>
</body>
<script>
// the html specification calls for having the script tag in the head, but this will error out because the body.h1 element would not rendered on the page yet
@EricRohlfs
EricRohlfs / rlang_text_corpus_helpers
Created September 19, 2021 17:00
corpus helpers
pivotDFM <- function(dfm){
dfm_dt <- dfm %>%
convert(to ="data.frame") %>%
setDT(keep.rownames = c("docid","doc_id")) #convert to data.table
pivoted <- melt(dfm_dt, id.vars = "docid") %>%
mutate(document = if_else( docid == 1, .$value[1], .$value[2])) %>%
setcolorder(c("docid","document","variable","value")) %>%