Skip to content

Instantly share code, notes, and snippets.

View tristian2's full-sized avatar
🎯
Focusing on final MSc Data visualisation assignment and SharePoint migration

tristian o'brien tristian2

🎯
Focusing on final MSc Data visualisation assignment and SharePoint migration
View GitHub Profile
@tristian2
tristian2 / gist:eaac1a50c15784a6813525edfe5d5a92
Created September 20, 2018 23:01
deepdream google cloud for the band MoonDrive71
sudo apt install git-all
git clone https://github.com/kesara/deepdreamer.git
wget https://raw.githubusercontent.com/BVLC/caffe/master/models/bvlc_googlenet/deploy.prototxt
add line to deploy.prototxt file (use sudo nano deploy.prototxt)
force_backward: true
wget http://dl.caffe.berkeleyvision.org/bvlc_googlenet.caffemodel
wget http://places.csail.mit.edu/model/googlenet_places205.tar.gz
Untar &move
@tristian2
tristian2 / sitesForR.ps1
Created September 19, 2018 10:44
look at sites hierarchy and output as css, for further analysis in R
clear-host
#depict the site hierarchy, for further analysis in R or SPSS
#setup csv
Add-Content -Path C:\SiteStructure.csv -Value '"Node","Parent","Template"'
function GetAllWebs($url)
{
try
{
$w = Get-SPWeb -identity $url;
@tristian2
tristian2 / createSubSiteBasicTestGroups.ps1
Last active September 7, 2018 10:20
subsite default groups association demo why it doesnt work
Clear-Host
#my tenancy
#based upon
#https://sharepoint.stackexchange.com/questions/239489/sharepoint-pnp-powershell-how-to-provision-sub-webs-with-unique-permissions-an
#at this poiint this doesn not setup the association, so it doesnt work. sets up the groups nicely though
$UserName= "tristian2@******.onmicrosoft.com"
$Password = "*******"
$SiteUrl = "https://******.sharepoint.com"
$subsite = "testSubSite"
$subsiteTitle = "test SubSite"
@tristian2
tristian2 / RESTful SharePoint Online data
Created August 24, 2018 14:09
How to get data from a SharePoint online list using REST
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script src="js/JSON-to-Table.min.1.0.0.js"></script>
<script>
/**********************/
function removeMySiteLink(username) {
var webAbsoluteUrl = window.location.protocol + "//" + window.location.host + _spPageContextInfo.siteServerRelativeUrl;
var art = null;
var migratedDate = "";
//IE
if (window.ActiveXObject) {
art = new ActiveXObject("Microsoft.XMLHTTP");
}//Mozilla, chrome, etc.,
else if (window.XMLHttpRequest) {
@tristian2
tristian2 / Ships.js
Created August 19, 2016 14:36
BattleShips demo of how we can "subclass" in JS
//from https://github.com/tristian2/BattleShipsJS
var TrisCorp = TrisCorp || {};
TrisCorp.BattleShips = TrisCorp.BattleShips || {};
TrisCorp.BattleShips.Ship = TrisCorp.BattleShips.Ship || {};
/**
@constructor
@abstract
*/
TrisCorp.BattleShips.Ship = function() {
if (this.constructor === TrisCorp.BattleShips.Ship) {
@tristian2
tristian2 / gist:54bc9febfd2be5b30467dfd300e5891d
Created August 10, 2016 11:37
BattleShips port rom GROOVY to c#
//one
using System;
using System.Collections;
using System.Linq;
public class Program
{
public static void Main()
{
Console.WriteLine("Start");
@tristian2
tristian2 / gist:936c6a388c0bd2e20da2286d890faf33
Created August 4, 2016 09:08
my 2016 AutSPInstaller file with powershell
<?xml version="1.0" ?>
<!-- AutoSPInstaller Sample Configuration File
General Instructions:
1. If you use the characters ' " < > & in your configuration (e.g. in passwords) you should encode them as follows:
' &apos;
" &quot;
< &lt;
> &gt;
& &amp;
@tristian2
tristian2 / Preplog.cpp
Created August 3, 2016 14:25
Preplog.cpp
/*
****************************************************************
* File: preplog.cpp
* Author: David Grant(MS)
* Purpose: Removes lines beginning with "#" from an input
* text file
* Written to remove header lines from IIS
* web logs for BULK IMPORT to SQL
*
* Disclaimer: This code is to be used for sample purposes only
cls
$certPath = "C:\Certs\TrisOfficePnP.cer"
$cert = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$cert.Import($certPath)
$rawCert = $cert.GetRawCertData()
$base64Cert = [System.Convert]::ToBase64String($rawCert)
$rawCertHash = $cert.GetCertHash()
$base64CertHash = [System.Convert]::ToBase64String($rawCertHash)
$KeyId = [System.Guid]::NewGuid().ToString()