This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Create-SVCProxies{ | |
[CmdletBinding()] | |
param([Parameter(Mandatory=$true)]$endpoint); | |
# If the endpoint name contians .svc , give it a more reasonable classname. | |
$className = $endpoint.Name -replace ".svc" , ""; | |
# WMF5 required (PowerShell 5) | |
$f = New-TemporaryFile; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -AssemblyName System.Web; | |
$samlFile = "C:\Tmp\Assertion.xml" | |
$serviceProviderUri = "http://MYAPP/Sso/Acs" | |
function Get-SamlPayload($file){ | |
$f = Get-ChildItem $file; | |
# If the file is an xml, content must be encoded. | |
if($f.Extension -match ".xml"){ | |
$payload = ([xml](Get-Content $file)).InnerXml; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple PowerShell script to load-test / test REST api with headers and cookies. | |
# Harald S. Fianbakken | |
$headers = @{ | |
"Accept"= "application/zip"; | |
"Accept-Encoding"= "gzip,deflate,sdch"; | |
"My-Token-ID" = "This_is_a_test"; | |
}; | |
function Create-Cookie($name, $value, $domain, $path="/"){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$loginBase = "https://itunesconnect.apple.com"; | |
$loginUrl = "$($loginBase)/WebObjects/iTunesConnect.woa"; | |
# Load the login-page | |
$r = Invoke-WebRequest $loginUrl -SessionVariable ws; | |
# Set the login data | |
$form = $r.Forms[0]; | |
$form.Fields["theAccountName"] = "[email protected]"; | |
$form.Fields["theAccountPW"] = "this_is_my_password"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$test=@" | |
using System; | |
using System.IO; | |
using System.Media; | |
public class Beep | |
{ | |
public static void Play( double frequency, double duration ) | |
{ | |
BeepBeep( 1000, frequency, duration ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('MyApp').config(function($httpProvider){ | |
$httpProvider.interceptors.push(function($rootScope, $q){ | |
return { | |
'request': function(config){ | |
config.timeout = 5000; | |
return config; | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$method1 = [scriptblock]{ | |
gc Data\SwissProt.xml, Data\SwissProt.xml|Set-Content -Path Output.xml | |
} | |
$method2 = [scriptblock]{ | |
gc -ReadCount 512 Data\SwissProt.xml, Data\SwissProt.xml|Set-Content -Path Output2.xml; | |
} | |
#Measure-Command -Expression $method1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get a continous log stream and pass it down the line | |
gc .\Data\Sample.log -Tail 3 -Wait|Select-String "MyAwsomePattern" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.removeInsuranceCard = function(card){ | |
var confirmed = confirm('Do you want to remove this item?'); | |
if(confirmed){ | |
$log.debug("Removing item @"+$scope.data.selectedIndex); | |
$scope.data.items.splice($scope.data.selectedIndex,1); | |
$scope.selectedItem = $scope.data.items[$scope.data.selectedIndex]; | |
$stateParams.index = $scope.data.selectedIndex; | |
// Force GUI TO be updated when removing the item bug in the carousel | |
$state.transitionTo($state.current, $stateParams, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
controller : function ($scope, $log, $stateParams, init, service) { | |
var ctrl = new slideController($scope,$log,$stateParams,init); | |
$scope.addInsuranceCard = function(){ | |
$scope.data.items.push({}); | |
} | |
$scope.removeInsuranceCard = function(card){ | |
var confirmed = confirm('Do you want to remove this item?'); | |
if(confirmed){ |
NewerOlder