Skip to content

Instantly share code, notes, and snippets.

@KanwarSingh
KanwarSingh / DomainEnableSPO
Created April 3, 2019 03:46
Enable External Domain in SPO
Tenant tenant = new Tenant(_context);
SPOSitePropertiesEnumerable prop = null;
prop = tenant.GetSiteProperties(0, true);
_context.Load(prop);
_context.ExecuteQuery();
foreach (SiteProperties sp in prop)
{
try
{
@KanwarSingh
KanwarSingh / Pfx to PEM
Created June 29, 2018 05:31
Pfx to PEM
\\bin\openssl pkcs12 -in WebAppSelfSignedSSO.pfx -out WebAppSelfSignedSSO.pem
@KanwarSingh
KanwarSingh / PemToPfx
Created June 29, 2018 05:28
Convert Pem to Pfx
\\openssl pkcs12 -export -in WebAppSelfSignedSSO.pem -out new-WebAppSelfSignedSSO.pfx -CSP "Microsoft Enhanced RSA and AES Cryptographic Provider"
@KanwarSingh
KanwarSingh / Context Request Timeout
Last active April 30, 2018 00:16
Context Request Timeout
// Set the timeout to infinite
Context.RequestTimeout = System.Threading.Timeout.Infinite;
@KanwarSingh
KanwarSingh / UserAgent Example
Last active April 30, 2018 00:15
User Agent Example
// Add our User Agent information
context.ExecutingWebRequest += delegate (object sender, WebRequestEventArgs e)
{
e.WebRequestExecutor.WebRequest.UserAgent = "NONISV|CompanyName|GovernanceCheck/1.0";
};
context.ExecuteQuery();
gulp.task("setConstants", (env => {
return gulp
.src(["./**/config/env/*.base.json"])
.pipe(debug())
.pipe(
map(function (file, cb) {
// Add code to alter
})
)
.pipe(gulp.dest(function (file) {
gulp.tasks('filewatch', function(){
return
gulp.watch('./src/**/*.js' , [ task1 , task2
]);
});
gulp.task("NewTask", function() {
return gulp
.src(["./**/config/env/*.base.js"])
// alter the files that match the source pattern
});
gulp.task("NewTask", function() {
return gulp
.src(["./**/config/env/*.base.js"])
.pipe(debug())
.pipe(prettyData({type: ‘prettify’}))
.pipe(uglify())
.pipe(gulp.dest(‘./build/release’));
});