Skip to content

Instantly share code, notes, and snippets.

View akhileshnirapure's full-sized avatar

Akhilesh Nirapure akhileshnirapure

View GitHub Profile
@akhileshnirapure
akhileshnirapure / Get-AzureADPSPermissions.ps1
Created May 19, 2020 16:42 — forked from psignoret/Get-AzureADPSPermissions.ps1
Script to list all delegated permissions and application permissions in Azure AD
<#
.SYNOPSIS
Lists delegated permissions (OAuth2PermissionGrants) and application permissions (AppRoleAssignments).
.PARAMETER DelegatedPermissions
If set, will return delegated permissions. If neither this switch nor the ApplicationPermissions switch is set,
both application and delegated permissions will be returned.
.PARAMETER ApplicationPermissions
If set, will return application permissions. If neither this switch nor the DelegatedPermissions switch is set,
@akhileshnirapure
akhileshnirapure / Application
Created March 9, 2018 14:37 — forked from simonproctor/Application
Delegate factory example for Autofac. Shows an ordinary factory and a factory returning owned instances.
namespace Demo
{
public class Application
{
private readonly IContainer container;
public Application()
{
ContainerBuilder builder = new ContainerBuilder();
builder.RegisterType<Biscuit>().As<IDependency>().Named<IDependency>("biscuits");
@akhileshnirapure
akhileshnirapure / TransformConfig.msbuild
Created May 18, 2017 11:42 — forked from romipetrelis/TransformConfig.msbuild
Transform configs (conditionally) after build
<Target Name="AfterBuild">
<CallTarget Condition="$(IsAgentBuild)=='true'" Targets="TransformConfig" />
<CallTarget Condition="!($(IsAgentBuild)=='true')" Targets="PreviewTransformedConfig" />
</Target>
<Target Name="TransformConfig">
<ItemGroup>
<DeleteAfterBuild Include="$(WebProjectOutputDir)\web.*.config"/>
</ItemGroup>
<TransformXml Source="web.config" Transform="$(ProjectConfigTransformFileName)" Destination="$(WebProjectOutputDir)\web.config" />
@akhileshnirapure
akhileshnirapure / JS-LINQ.js
Created March 13, 2017 12:16 — forked from DanDiplo/JS-LINQ.js
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
{ name: "Judy", age: 42 },
{ name: "Tim", age: 8 }
@akhileshnirapure
akhileshnirapure / LS.SP.JSOM.js
Created February 9, 2017 11:09 — forked from zplume/LS.SP.JSOM.js
SharePoint 2013 REST / JSOM / Utility functions (work in progress)
(function() {
var nsName = "LS"; // root namespace name
var ns = window[nsName]; // root namespace alias
var utils = ns.Utils; // utils alias
ns.SP = ns.SP || {};
ns.SP.JSOM = {
Data: {
Sites: {} // cache for Taxonomy terms JSON
},
@akhileshnirapure
akhileshnirapure / angular.md
Created January 31, 2017 05:22 — forked from sinedied/angular.md
The Missing Introduction to Angular 2 and Modern Design Patterns

Introduction to Angular

Angular (aka Angular 2) is a new framework completely rewritten from the ground up, replacing the famous AngularJS framework (aka Angular 1.x).

More that just a framework, Angular should now be considered as a whole platform which comes with a complete set of tools, like its own CLI, debug utilities or performance tools.

Getting started

@akhileshnirapure
akhileshnirapure / TW-CreateBlankClientExtranetSite.ps1
Created October 11, 2016 13:31 — forked from pkskelly/TW-CreateBlankClientExtranetSite.ps1
Add a blank site collection to an Office 365 tenant in SharePoint Online
# =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
# Script: TW-CreateBlankClientExtranetSite.ps1
#
# Author: Pete Skelly
# Twitter: ThreeWillLabs
# http://www.threewill.com
#
# Description: Add a blank site collection to an Office 365 tenant in SharePoint Online
#
# WARNING: Script provided AS IS with no warranty. Your mileage will vary. Use
<div ng-app="wizardApp">
<div ng-controller="WizardSignupController">
<h2>Signup wizard</h2>
<div ui-view></div>
</div>
</div>
<script type="text/javascript" src="/js/vendor/angular-ui-router/release/angular-ui-router.min.js"></script>
<script type="text/javascript">
angular.module('wizardApp', [
'ui.router',
@akhileshnirapure
akhileshnirapure / angular-typescript-providers.ts
Created September 29, 2016 12:30 — forked from jepetko/angular-typescript-providers.ts
demonstrates how to define angularjs providers in Typescript
//Example 1: inline definition... not configurable :-(
angular.module("myApp", [])
.provider("Dummy", <ng.IServiceProvider>{
'$get': function() {
return { value: 1 };
}
})
.config(["DummyProvider", function(Dummy: ng.IServiceProvider) {
@akhileshnirapure
akhileshnirapure / Update-SPTokenLifetime.ps1
Created September 22, 2016 15:21 — forked from janikvonrotz/Update-SPTokenLifetime.ps1
PowerShell: Update SharePoint Token Lifetime #SharePoint #PowerShell
if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft.SharePoint.PowerShell"}
# update SharePoint cache token lifetime
$SPContentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$SPContentService.TokenTimeout = (New-TimeSpan -minutes 5)
$SPContentService.Update()
# udpate SharePoint claims token lifetime