Skip to content

Instantly share code, notes, and snippets.

View nonprofittechy's full-sized avatar

Quinten Steenhuis nonprofittechy

View GitHub Profile
---
modules:
- docassemble.base.util
---
mandatory: True
code: |
menu_items = [ {'url': url_ask(['share_fields', 'share_success', {'recompute': ['share_email','sent_sharing_email','share_cell','sent_sharing_text']}]), 'label': 'Share interview'}]
---
code: |
if share_email:
---
modules:
- docassemble.base.util
- .discovery
---
mandatory: True
need: all_answer_variables
code: |
other_ints.there_are_any = False
other_drq.there_are_any = False
$numLen = 7
$prefix= "GBLS-"
$ComputerModel = (Get-WmiObject -Class Win32_ComputerSystem | Select-Object Model).Model
$SerialNumber = (Get-WmiObject -Class Win32_BIOS | Select-Object SerialNumber).SerialNumber
if ($serialNumber.length -ge 7) {
$shortSerial = $serialNumber.substring($serialNumber.length - $numLen,$numLen)
} else {
$shortSerial = $serialNumber
}
Copy-Item -Path $PSScriptRoot'\LayoutModification.xml' -Destination $env:SystemDrive'\Users\Default\AppData\Local\Microsoft\Windows\Shell'
Copy-Item -Path $PSScriptRoot'\Internet Explorer.lnk' -Destination $env:SystemDrive'\ProgramData\Microsoft\Windows\Start Menu\Programs\Accessories'
function runEvaluation() {
console.log("before disabled");
this.disabled = true;
console.log("after disabled");
$('#error').remove();
var origin = $('input[name=origin]:checked').val();
var dest = $('input[name=dest]:checked').val();
var savePrefs = $('#save-prefs').is(':checked');
google.script.run
.withSuccessHandler(
@nonprofittechy
nonprofittechy / code.gs
Last active January 21, 2018 09:47
snippet from code.gs - WriteClearly Google Docs Add On
/**
* Return a single score for the selected text
* @param {string} text text to evaluate, can include HTML elements
* @return {object} object -- has the index (score) and a list of suggestions
*/
function getTextEvaluation() {
var selection = DocumentApp.getActiveDocument().getSelection();
if(selection) {
var textArray = getSelectedText();
} else {
<#
.SYNOPSIS
Create GPOs that set the Administrative Template for "Default SharePoint Lists" as specified in a CSV.
The CSV can update (or create) multiple GPOs based on the column "gpoName".
.DESCRIPTION
The input CSV has 5 mandatory columns:
gpoName : Name of the GPO to update
ou : the name of the OU to link the GPO to
siteName : Site name on Sharepoint
<#
.SYNOPSIS
Updates lists with "Contacts" in the name, replacing any empty "Last Name" fields
with the company name, to prepare for migration to SharePoint Online.
Syntax: fix_missing_lastname.ps1 -url "https://my.sharepoint.site" or update parameter below
.DESCRIPTION
Will scan one-level deep for sub-sites that have a list with 'Contacts' in the title.
.NOTES
<#
.SYNOPSIS
Generates the STSSyncURLs for a Sharepoint Online Site using CSOM. Should be run from a SharePoint server.
TODO: identify which DLL contains the microsoft.sharepoint.utilities.spencode method to allow running without a SharePoint install.
.DESCRIPTION
This script is useful for generating a long list of STSSYNC urls without tediously connecting dozens of lists to Outlook, sharing them, and extracting
the URL in that fashion. The output is a PSOBject which can be piped to a CSV for further manipulation, or to a separate script that creates appropriate GPOs
or .REG files for further automation.
Requires load-csomproperties.ps1 from: https://gist.github.com/glapointe/cc75574a1d4a225f401b
.EXAMPLE
<#
Removes the specified Sharepoint Lists from Outlook.
Uses Outlook MAPI and must run on each user's workstation. Deploy as a script with GPO or System Center
Author: Quinten Steenhuis, 9/26/2016
#>
<#
# Uncomment this section and update with your own lists to remove. If left
# unspecified, this script will rely on the default list set via GPO for SP 2013
# Please note you'll need to update the GPO before next refresh cycle if relying on