Skip to content

Instantly share code, notes, and snippets.

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 Sep 20, 2018
deepdream google cloud for the band MoonDrive71
View gist:eaac1a50c15784a6813525edfe5d5a92
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 Sep 19, 2018
look at sites hierarchy and output as css, for further analysis in R
View sitesForR.ps1
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 Sep 7, 2018
subsite default groups association demo why it doesnt work
View createSubSiteBasicTestGroups.ps1
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 Aug 24, 2018
How to get data from a SharePoint online list using REST
View RESTful SharePoint Online data
<!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>
View SharePoint 2010 webservices calls to do various things to the page
/**********************/
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 Aug 19, 2016
BattleShips demo of how we can "subclass" in JS
View Ships.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 Aug 10, 2016
BattleShips port rom GROOVY to c#
View gist:54bc9febfd2be5b30467dfd300e5891d
//one
using System;
using System.Collections;
using System.Linq;
public class Program
{
public static void Main()
{
Console.WriteLine("Start");
@tristian2
tristian2 / gist:936c6a388c0bd2e20da2286d890faf33
Created Aug 4, 2016
my 2016 AutSPInstaller file with powershell
View gist:936c6a388c0bd2e20da2286d890faf33
<?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;
View 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
View PS get Shizzle from key for AzureAD
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()
You can’t perform that action at this time.