Skip to content

Instantly share code, notes, and snippets.

View PatD's full-sized avatar

Patrick Doran PatD

View GitHub Profile
@PatD
PatD / pbi.html
Last active October 21, 2020 17:17
Power BI "Publish to Web" CSS to hide gray bar under report
<!--
In <iframe>, adjust height to some number safely above the height of the embed page
Tweak the 3rd clip value to some reasonable number to hide the gray bar
Adjust the min-height in .pbi
-->
<style>
@PatD
PatD / sharepoint_axios_fuse_handlebars_search.html
Created October 20, 2020 10:22
Custom search interface with SharePoint REST API, Axios.js, Fuse.js, and Handlebars.js
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="">
@PatD
PatD / sharepoint_logo_watermarker.html
Created July 2, 2020 20:13
Add logo watermark to SharePoint (classic) image-renditioned photos in a Picture library.
<style>
/* We're inside an iframe */
#waterMarkedImage{
background:url('/_layouts/images/gears_an.gif') top left no-repeat;
min-height:300px;
}
</style>
<!-- Rendition choices are injected here -->
@PatD
PatD / load_sharePoint_list_items_REST_axios_to_tabulator.html
Created June 22, 2020 18:40
Load SharePoint data to Tabulator table via REST, then save selected items to LocalStorage
<!-- Tabulator.js styles-->
<link href="/site/wz-eva/makecard/js/tabulator.min.css" rel="stylesheet">
<!-- Custom styles-->
<style>
.tabulator-selected .workzonecheckbox::after {
content: 'x';
}
@PatD
PatD / poc.html
Created March 9, 2020 20:36
Azure Computer Vision API - Handwriting POC
<!DOCTYPE html>
<html>
<head>
<title>Text Recognition Sample</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.19.2/axios.min.js"></script>
</head>
<body style="margin:1em;">
@PatD
PatD / convert_sp_item_to_pdf.js
Created February 26, 2020 12:32
Convert single SharePoint List Item data to a PDF file with JavaScript. All client side.
/*
README
Code reads query string parameter (the ID of the SharePoint List Item),
makes a GET request against SharePoint List for that item, then
converts response to a PDF file. PDF is dispalyed inline on the page,
or downloaded if IE.
*/
<html>
<body>
<style>
#bikePedDropDowns select{width:99%}
/* #bikePedDropDowns .col20{width:18%} */
@media only screen and (min-width: 960px){
#bikePedDropDowns .col20 {
width: 18%;
@PatD
PatD / dropdown_picker.html
Created December 9, 2019 20:53
Dual Dropdown SharePoint REST Filtering Javascript
<label for="ContractorName">Select your contractor organization from this list:</label><br />
<select name="ContractorName" id="ContractorName">
<option value="Select" selected="selected">Select</option>
<option value="ACME">Acme</option>
</select>
<label for="traineesDropdown">Choose a Trainee from this list:</label><br />
@PatD
PatD / write-cookie.js
Created November 2, 2019 19:25
Set a cookie to expire tomorrow. Check for it's existance on run, and update content if cookie is already set.
@PatD
PatD / gist:f6023ac4df38cd1af513159d5c9a8929
Created June 12, 2019 20:08
SharePoint Calculated HTML Column Example
="<div style='margin-left:10px;float:left;text-align:left;width: 100%;margin-top: 10px;'>
<a href='https://www.bing.com/maps?where1="&address&" "&city&" NC "&zip&"&rtop=0~1~0' target='_blank'>
<img width='500' height='150' src='https://dev.virtualearth.net/REST/V1/Imagery/Map/Road/"&address&"%2C"&city&"%2CNC%2C"&zip&"/15?mapSize=800,300&format=png&key=MYBINGKEYNOTABINKEY' />
</a><br />
</div>"