Skip to content

Instantly share code, notes, and snippets.

View dennythecoder's full-sized avatar

Denny dennythecoder

View GitHub Profile

Run PowerShell as Admin

$machineName = "MachineName"
Enable-PSRemoting -force 
Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value $machineName
Enter-PSSession -ComputerName $machineName -Credential (Get-Credential)
@dennythecoder
dennythecoder / SP Rest Get Lists.js
Created November 8, 2019 01:59
SP 2010 Get List example
function getList(name, cb){
var serviceUrl = 'http://yoursite/_vti_bin/listdata.svc/';
var xhr = new XMLHttpRequest();
xhr.open('GET', serviceUrl + name);
xhr.setRequestHeader('accept', 'application/json;odata=verbose');
xhr.onreadystatechange = function(){
if(this.readyState === 4){
var obj = JSON.parse(this.response);
cb(obj.d.results);
@dennythecoder
dennythecoder / openSchema.js
Last active January 25, 2019 04:22
Open Schema Values enumerated
/*
Open Schema Values enumerated in JavaScript
https://docs.microsoft.com/en-us/sql/ado/reference/ado-api/schemaenum?view=sql-server-2017
*/
const openSchema = {
adSchemaAsserts: 0,
adSchemaCatalogs: 1,
adSchemaCharacterSets: 2,
adSchemaCheckConstraints: 5,
(function(){
var href = location.href;
if(href.indexOf('logout') !== -1){return ;}
var userAgree = sessionStorage.getItem('user_agree');
if(userAgree !== 'true'){
var msg = 'You are accessing a U.S. Government (USG) Information System (IS) that is provided for USG-authorized use only.\n' +
'By using this IS (which includes any device attached to this IS), you consent to the following conditions:\n'+
function JSAssert_print() {
var win=window.open("","_blank","width=400,height=300,toolbar=no,scrollbars=yes");
win.document.writeln("<TITLE>JSUnit</TITLE><PRE>");
win.document.writeln(""+this.count+" test(s): "+this.done+" ok, "+this.failed+" failed\n---");
win.document.writeln(this.text);
win.document.close();
}
function JSAssert_add(f, t) {
this.count++;
@dennythecoder
dennythecoder / script.js
Last active May 24, 2018 00:40
PDFJS Wrapper to handle DD Form 2875.
/*
Usage:
const file = document.getElementById('a_file').files[0];
const fh = new FileHandler(file);
console.log(fh.fields.name, fh.fields.email);
*/