Skip to content

Instantly share code, notes, and snippets.

View codegard1's full-sized avatar

Chris Odegard codegard1

View GitHub Profile
@codegard1
codegard1 / nintex-show-attachments.js
Last active June 30, 2023 14:28
Show current item's attachments on the form
/* In the context of a Nintex form in SharePoint:
/* use jQuery (NWF$) to fetch the attachments of the current list item and display them
/* on the form, using a DIV element inside a Multiline Text Control as the container. */
NWF.FormFiller.Events.RegisterAfterReady(function () {
/* CONFIGURATION */
var siteURL = "https://site.com"; // no trailing slash
var listName = "A List of Items with Image Attachments" // use the list display name;
var itemId = GetUrlKeyValue('ID'); // or ({ItemProperty:ID}) if you are embedding the code into the form
Module: matrix-multiplication
Synopsis:
Author: Chris Odegard
Copyright: 2018
define class <matrix> (<object>)
slot name :: <string>, init-value: "Matrix";
slot rows :: <integer>, init-value: 3;
slot cols :: <integer>, init-value: 3;
slot multiplier :: <integer>, init-value: 5;
@codegard1
codegard1 / pageview-tracker.js
Created November 28, 2018 14:52
Script to log page views in SharePoint. Include this script in the master pages to track user activity
function main() {
console.time("pageview");
SP.SOD.executeFunc("SP.js", "SP.ClientContext", function() {
/**
* Create a new item in the pageview list at ~/lists/pageviews
*/
// Get the querystring
var queryString = window.location.href.split("?")
<div id="results"></div>
<script type="text/javascript">
console.time('initialize');
function retrieveWebSiteProperties(siteUrl) {
var clientContext = SP.ClientContext.get_current();
this.oWebsite = clientContext.get_web();
this.collList = oWebsite.get_lists();
this.listInfoCollection = clientContext.load(collList);
Build project .\matrix-multiplication from .\matrix-multiplication.lid
...
Opened project matrix-multiplication (C:\Users\n5014\Documents\git\algorithms\matrix-multiplication\matrix-multiplication.hdp)Loading namespace for library matrix-multiplicationUpdating definitions for library matrix-multiplication
C:\Users\n5014\Documents\git\algorithms\matrix-multiplication\matrix-multiplication.dylan:34: Serious warning - Unexpected token ")".
-
if (j < (rows(m)) - 1))
-
Computing data models for library matrix-multiplication
Computing code models for library matrix-multiplication
@codegard1
codegard1 / sharepointmenu.css
Created February 25, 2019 19:48
SharePoint Menu css
.ms-core-listMenu-horizontalBox {
border: 1px lime solid;
}
.ms-core-listMenu-horizontalBox::before {
content: "Menu";
color: red;
}
.ms-core-listMenu-horizontalBox .ms-core-listMenu-root {
display: none;
@codegard1
codegard1 / GenerateDates.sql
Created December 16, 2019 21:04
SQL Script to populate DimDate
USE AWDataWarehouse
GO
-- Populate DimDate dimension table with values from 1/1/2000 to 1/1/2003
-- declare variables to hold the start and end date
DECLARE @StartDate datetime
DECLARE @EndDate datetime
--- assign values to the start date and end date we
-- want our reports to cover (this should also take
@codegard1
codegard1 / DimDate.sql
Created December 16, 2019 21:06
Sql script to create DimDate table
USE AWDataWarehouse
GO
-- Create DimDate dimension table
CREATE TABLE [dbo].[DimDate](
[DateKey] [int] NOT NULL PRIMARY KEY NONCLUSTERED,
[FullDateAlternateKey] [date] NOT NULL,
[DayNumberOfWeek] [tinyint] NOT NULL,
[DayNameOfWeek] [nvarchar](10) NOT NULL,
[DayNumberOfMonth] [tinyint] NOT NULL,
@codegard1
codegard1 / scrfrmt4.rtf
Last active February 7, 2020 14:22
Sub Station Alpha v4.00 Script Format
{\rtf1\ansi \deff4\deflang1033{\fonttbl{\f4\froman\fcharset0\fprq2 Times New Roman;}{\f5\fswiss\fcharset0\fprq2 Arial;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;
\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;
\red192\green192\blue192;}{\stylesheet{\widctlpar \f4\fs20 \snext0 Normal;}{\*\cs10 \additive Default Paragraph Font;}}{\info{\author Kotus}{\operator SEWP 3.0 Development}{\creatim\yr1998\mo8\dy30\hr23\min30}{\revtim\yr1998\mo12\dy18\hr13\min13}
{\version2}{\edmins104}{\nofpages18}{\nofwords4155}{\nofchars23686}{\*\company }{\vern57443}}\paperw11909\paperh16834\margl1080\margr1080\margt1080\margb1080 \widowctrl\ftnbj\aenddoc\hyphcaps0 \fet0\sectd \linex0\headery706\footery706\colsx709
{\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\p
@codegard1
codegard1 / Macrov2.ps1
Last active March 3, 2020 04:40
Flatten List Test
Function Get-ParentRows {
<#
.SYNOPSIS
Returns rows that have no Parent ID and where Comments is not blank
#>
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[Array]$CSVData