Skip to content

Instantly share code, notes, and snippets.

View jwstl's full-sized avatar

Jason White jwstl

View GitHub Profile
@dudelis
dudelis / k2-startdev-asaservice.ps1
Created January 2, 2018 22:31
K2: Run development license as a service
# Remove the existing K2 Blackpearl Server service
sc.exe delete "K2 blackpearl Server"
# 2. Run nssm configuration
C:\NSSM\win64\nssm.exe install "K2 blackpearl Server"
@dudelis
dudelis / k2-folio-update.ps1
Created December 18, 2017 15:36
K2: Update Process Instance folio
Function Update-Folio ([int]$procInstId, [string]$folio){
if(-not($procInstId)) { Throw "You must supply a value for -procInstId" }
if(-not($folio)) { Throw "You must supply a value for -folioName" }
Add-Type -AssemblyName ('SourceCode.Workflow.Client, Version=4.0.0.0, Culture=neutral, PublicKeyToken=16a2c5aaaa1b130d')
$k2con = New-Object -TypeName SourceCode.Workflow.Client.Connection
$k2con.Open("localhost")
$procInst = $k2con.OpenProcessInstance($procInstId);
$procInst.Folio = $folio;
$procInst.Update()
@dudelis
dudelis / k2-listview-checkboxes.js
Last active May 4, 2018 20:50
K2: Select Listview rows with checkboxes
//You need to do the following for the code to work:
//1. Add Literal datalabel to the list view and call it 'dlblScript'.
//2. Add a new column into the list view, add literal datalabel there and add a piece of the following html inside:
<input type="checkbox" class="custom-box"/>
//3. Add the following js into the dlblScript:
<script>
var contentTable = $("span[name='dlblScript']").closest('.grid').find('.grid-content-table')[0];
var observer = new MutationObserver(function(mutations){
$(contentTable).find('.custom-box').each(function(i, val){
if ($(this).prop('checked')){
[System.Serializable]
public struct RangedFloat
{
public float minValue;
public float maxValue;
public RangedFloat(float minValue, float maxValue)
{
this.minValue = minValue;
this.maxValue = maxValue;
@posener
posener / go-shebang-story.md
Last active March 29, 2024 08:38
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@vgrem
vgrem / createNewDiscussionReply.js
Created September 12, 2016 12:13
Demonstrates how to create a message (reply) in Discussion Board via SharePoint REST API
function executeJson(options)
{
var headers = options.headers || {};
var method = options.method || "GET";
headers["Accept"] = "application/json;odata=verbose";
if(options.method == "POST") {
headers["X-RequestDigest"] = $("#__REQUESTDIGEST").val();
}
var ajaxOptions =
<Query Kind="Program">
<NuGetReference>Octokit</NuGetReference>
<NuGetReference>Octokit.Reactive</NuGetReference>
<NuGetReference>Rx-Main</NuGetReference>
<Namespace>Octokit</Namespace>
<Namespace>System.Linq</Namespace>
<Namespace>System.Reactive.Linq</Namespace>
<Namespace>System.Threading.Tasks</Namespace>
</Query>
@ProGM
ProGM / find_useless_resources_unity.sh
Last active January 8, 2022 10:04
A useful script to identify Unity resource that are not referenced in the project
#!/bin/bash
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
NC='\033[0m'
rm unused_files.log &> /dev/null
grep -r . --include=\*.meta --exclude=*{Editor,Gizmos}* -e 'guid' | while read line; do
@joecih
joecih / HighChartDemo1.js
Last active November 9, 2016 20:38
High Chart Demo for SharePoint 2013 [ https://jsfiddle.net/JoeciH/asdstm93/ ]
<script type="text/javascript" src="/Style%20Library/jquery-1.11.2.js"></script>
<script type="text/javascript" src="/Style%20Library/highcharts.js"></script>
<script type="text/javascript">
var splistitems;
var seriesarray = new Array();
ExecuteOrDelayUntilScriptLoaded(GetChartData, "sp.js");
function GetChartData() {
@andrewconnell
andrewconnell / SharePoint 2013 SPA UX Template - Header
Created February 18, 2014 10:56
HTML template of the header for used to create a SharePoint 2013 Hosted App (SPH) Single Page App (SPA).
<div id="s4-titlerow" class="ms-dialogHidden" style="display:block;">
<div id="titleAreaBox" class="ms-noList ms-table ms-core-tableNoSpace">
<div id="titleAreaRow" class="ms-tableRow">
<div id="siteIcon" class="ms-tableCell ms-verticalAlignTop" style="width:180px;">
app logo goes here
</div>
<div class="ms-breadcrumb-box ms-tableCell ms-verticalAlignTop">
<div class="ms-breadcrumb-top">
<div class="ms-breadcrumb-dropdownBox" style="display:none;">
<span id="DeltaBreadcrumbDropdown"></span>