Skip to content

Instantly share code, notes, and snippets.

View adamzuckerman's full-sized avatar

Adam Zuckerman adamzuckerman

View GitHub Profile
@adamzuckerman
adamzuckerman / FindModulePage.SQL
Created February 20, 2016 02:15
Find the pages on DNN where a module has been used
SELECT TabID, REPLACE(HTTPAlias + TabPath, '//', '/') AS ThePage
FROM Tabs
INNER JOIN PortalAlias
ON Tabs.PortalID = PortalAlias.PortalID
AND PortalAliasID = (
SELECT MIN(pa.PortalAliasID)
FROM PortalAlias AS pa
WHERE Tabs.PortalID = pa.PortalID
)
WHERE TabID IN (SELECT TabID FROM TabModules WHERE ModuleID IN ( 0 ))
@adamzuckerman
adamzuckerman / createLocationList.js
Created February 3, 2016 02:17
JS to create JS to position PDF fields on a new document after copying
// Get the number of widgets associated with a field
function getWidgetCount(fieldName) {
var field = getField(fieldName);
if (!field) {
return 0;
}
if (field.page.length > 0) {
return field.page.length;
}
return 1;
@adamzuckerman
adamzuckerman / WE-Markdown.css
Last active February 8, 2016 15:52 — forked from alexander-87/WE-Markdown.css
Github Flavored Markdown Stylesheet for Web Essentials
/*
GitHub Flavored Markdown StyleSheet for Visual Studio Web Essentials
Original Source: https://gist.github.com/jerone/9925179
*/
@import url(https://fonts.googleapis.com/css?family=Arimo:400,400italic,700,700italic|Droid+Sans+Mono);
html {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
-moz-text-size-adjust: 100%;
text-size-adjust: 100%;
@adamzuckerman
adamzuckerman / main.cs
Created October 13, 2015 20:26
Using iTextSharp to create a TextField on an existing PDF
using iTextSharp.text;
using iTextSharp.text.pdf;
private static void Main(string[] args)
{
const string templateFilename = "template.pdf";
const string outputFilename = "output.pdf";
using (Stream inputPdf = new FileStream(templateFilename, FileMode.Open, FileAccess.Read, FileShare.Read))
{
@adamzuckerman
adamzuckerman / GetNuGetCommandLine.targets
Last active March 9, 2016 17:05
Get the NuGet CommandLine executable including path (version 2.8.6)
<UsingTask
TaskName="GetNuGetCommandLine"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<SolutionPath ParameterType="System.String" Required="true" />
<NuGetCommandLine ParameterType="System.String" Output="true" />
</ParameterGroup>