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
def testPalindrome(p): | |
p = str(p) | |
return not any([True for i in range(0,len(p)/2) if p[i] <> p[-i-1]]) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<feed xml:base="http://bd-xd7-01/Citrix/Monitor/OData/v1/Data/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> | |
<id>http://bd-xd7-01/Citrix/Monitor/OData/v1/Data/Sessions</id> | |
<title type="text">Sessions</title> | |
<updated>2014-01-08T20:19:50Z</updated> | |
<link rel="self" title="Sessions" href="Sessions" /> | |
<entry> | |
<id>http://bd-xd7-01/Citrix/Monitor/OData/v1/Data/Sessions(guid'5a84b30a-9190-4013-b458-81d64633c996')</id> | |
<category term="Citrix.Monitor.Repository.Session" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> | |
<link rel="edit" title="Session" href="Sessions(guid'5a84b30a-9190-4013-b458-81d64633c996')" /> |
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
## AutoGenerated file. Do Not Edit. Regenerate by running | |
## Add-UIModule -AssemblyName System.Windows.Controls.Ribbon -Name Ribbon | |
@{ | |
ModuleVersion = '1.0' | |
RequiredModules = 'ShowUI' | |
RequiredAssemblies = 'System.Xaml','System.Windows.Controls.Ribbon' | |
ModuleToProcess = 'Ribbon.psm1' | |
GUID = 'b307ebad-cfb1-4c34-895c-471792c513db' | |
FunctionsToExport = @('New-KeyTipControl','New-RibbonContextualTabGroupsPanel','New-RibbonGalleryCategoriesPanel','New-RibbonGalleryItemsPanel','New-RibbonGroupItemsPanel','New-RibbonGroupsPanel','New-RibbonMenuItemsPanel','New-RibbonQuickAccessToolBarOverflowPanel','New-RibbonQuickAccessToolBarPanel','New-RibbonTabHeadersPanel','New-RibbonTabsPanel','New-RibbonTitlePanel','New-StarLayoutInfo','New-Ribbon','New-RibbonMenuButton','New-RibbonApplicationMenu','New-RibbonMenuItem','New-RibbonApplicationMenuItem','New-RibbonSplitMenuItem','New-RibbonApplicationSplitMenuItem','New-RibbonButton','New-RibbonCheckBox','New-RibbonComboBox','New-RibbonContextMenu','New-Ri |
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
require.config({ | |
paths: { | |
"app": "../app" | |
} | |
}); | |
require(['splunkjs/mvc/simplexml/ready!'], function(){ | |
require(['splunkjs/ready!'], function(){ | |
// The splunkjs/ready loader script will automatically instantiate all elements | |
// declared in the dashboard's HTML. |
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
param( | |
[string[]]$ComputerName = ".", | |
[Parameter(Mandatory)] | |
[Management.Automation.Credential()] | |
[PSCredential]$Credential | |
) | |
$sessions = New-PSSession -ComputerName:$ComputerName -Credential:$Credential |
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 Test-DebugPreference { | |
[CmdletBinding()] | |
param($count = 1e5) | |
$Counter = 0 | |
for($i = 0; $i -lt $count; $i++) { | |
if($DebugPreference -gt "SilentlyContinue") { | |
$Counter += 1 | |
Write-Debug "The Counter is $Counter" | |
} |
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 Get-ParseResults { | |
param( | |
# The script or file path to parse | |
[Parameter(Mandatory=$true, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True)] | |
[Alias("Path","PSPath")] | |
$Script | |
) | |
$ParseErrors = $null | |
$Tokens = $null |
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
Import-Module poke -Force | |
$xlr8r = [psobject].assembly.gettype("System.Management.Automation.TypeAccelerators") | |
# ScriptBlock Parsing using a Parser Instance so we can pass it to the DefineTypeHelper later | |
function New-Type { | |
param( | |
[ScriptBlock]$TypeDefinition, |
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
# In the real world, I'm trying to use Nancy.NancyModule, but for demo's sake, it can be this simple: | |
add-type @' | |
namespace Nancy | |
{ | |
public abstract class NancyModule | |
{ | |
protected NancyModule() { } | |
} | |
} | |
'@ |
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 filesystem { | |
param( | |
[Parameter(ParameterSetName="Dirs",ValueFromPipeline)] | |
[System.IO.DirectoryInfo]$Directory, | |
[Parameter(ParameterSetName="Files",ValueFromPipeline)] | |
[System.IO.FileInfo]$File | |
) | |
process { | |
switch ($PSCmdlet.ParameterSetName) { |
OlderNewer