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
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")) %>% |
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
<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 |
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
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" |
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
<!-- 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> |
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 mockCommit = function (mutations, state) { | |
return function (type, payload) { | |
mutations[type](state, payload) | |
} | |
} | |
// how to do async unit test for vuex without creating a full store. | |
describe('inFlight vuex', () => { | |
let state | |
let mutations |
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
# PowerShell script to publish all the nuget packages in a project to VSTS Package server | |
$Dir = get-childitem D:\_delete\blah\WebApplication4 -recurse | |
# $Dir |get-member | |
$List = $Dir | where {$_.extension -eq ".nupkg"} | |
$List | format-table name | |
$List | ForEach-Object{ | |
$tempPath = Join-Path $_.Directory $_.name | |
D:\nuget.exe push -Source "MyNugetServerNameOrUrl" -ApiKey VSTS $tempPath | |
} |
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
# Downloads all the git projects from a Microsoft Visual Studio Team Services (VSTS) account. | |
# Helpful if a team has many git repositories. | |
# change these | |
$project = "myProject" | |
$whereToSaveRoot = "d:\myProject\" | |
# application start | |
$username = Read-Host -Prompt 'UserName from VSTS Alt Credentials' |
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 () { | |
/** | |
* Gist by @EricRohlfs for embeding yammer in an AngularJs SPA. | |
* Assumes you are using open graph and ng-route. | |
* Steps: | |
* 1. include the yammer api script as per their documentation | |
* <script type="text/javascript" src="https://assets.yammer.com/assets/platform_embed.js"></script> | |
* 2. Add the directives <yammer-embed/> or <yammer-follow/> to your page. | |
* 3. in your route config add the openGraph property for each route |
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
# ---------- Main Vars to Change----------------- | |
$contentPath = 'C:\MyApp\content' | |
# find the file at example : C:\Users\me\AppData\Local\Temp on my computer | |
$OutPath = "$env:temp\SharePointProjectItem.spdata.fragment.xml" | |
# --------- End Main Vars to Change------------ | |
# Code Summary |
NewerOlder