Skip to content

Instantly share code, notes, and snippets.

View PatD's full-sized avatar

Patrick Doran PatD

View GitHub Profile
@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.
@jrmoran
jrmoran / app.js
Created October 23, 2012 12:50
AngularJS - basic async request
var App = angular.module('App', []);
App.controller('TodoCtrl', function($scope, $http) {
$http.get('todos.json')
.then(function(res){
$scope.todos = res.data;
});
});