This file contains hidden or 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
<?php | |
/** | |
* This file contains the class ExamplePicture. | |
* @package ExampleMiddleWare | |
**/ | |
/** | |
* Include files | |
**/ | |
require_once("bmp.php"); |
This file contains hidden or 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 original data | |
$data = @{ | |
First = 'Justin'; | |
Last = 'Dearing'; | |
Resume = @{ | |
Experience = [HashTable[]]@( | |
@{ | |
StartDate = [DateTime] (Get-Date '2002-03-23'); | |
EndDate = [DateTime] (Get-Date '2007-05-15'); | |
Company = 'ACME ISP'; |
This file contains hidden or 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
$script:filename = "" | |
1..100 | % { | |
$script:filename = "$($env:temp)\deleteme-$($_).txt" | |
"Code: $(Get-Random 4-9)-$($_)" | |
} | Set-Content $script:filename |
This file contains hidden or 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 which I prove that that the terser [int][Math]::Floor($a/$b) gives the | |
same results as the technet recommended [Math]::Floor([int]$a / [int]$b) | |
Said technet recomendation is available at: | |
http://technet.microsoft.com/en-us/library/ee176879.aspx | |
One extra cast is probably slower too. | |
#> | |
1.. 1000 | ForEach-Object { | |
Foreach ($divisor in 2,3,5,7) { |
This file contains hidden or 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
<# | |
.SYNOPSIS | |
mstsc-Ac.ps1 (Version 1.0, 7 Jan 2012) | |
The author may be contacted via [email protected] | |
The latest authoritative version of this script is always available at | |
http://bit.ly/mstsc-Ac | |
.DESCRIPTION | |
This script will see if a host is up and listening on a given port, and start a | |
remote desktop connection to it. The idea is you run this script after rebooting a windows server | |
.EXAMPLE |
This file contains hidden or 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
*~ |
This file contains hidden or 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
*** Assembly Binder Log Entry (9/23/2011 @ 10:19:11 PM) *** | |
The operation was successful. | |
Bind result: hr = 0x0. The operation completed successfully. | |
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll | |
Running under executable C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe | |
--- A detailed error log follows. | |
=== Pre-bind state information === |
This file contains hidden or 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
USE master; | |
GO | |
IF EXISTS (SELECT name FROM sys.databases WHERE name = N'dropMe') | |
DROP DATABASE [dropMe] | |
GO | |
CREATE DATABASE dropMe; | |
GO | |
DECLARE @fileName VARCHAR(MAX) |
This file contains hidden or 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
$cn = New-Object System.Data.SqlClient.SqlConnection 'Data Source=.;Initial Catalog=master;Integrated Security=SSPI;'; | |
$cn.Open(); | |
$cmd = $cn.CreateCommand() | |
$cmd.CommandText="SELECT * FROM sys.tables" | |
$rdr = $cmd.ExecuteReader(); | |
$dt = New-Object System.Data.DataTable; | |
$dt.Load($rdr); | |
$dt.Rows | Format-Table; |
This file contains hidden or 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
# Copyright (c) 2011 Justin Dearing <[email protected]> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# The above copyright notice and this permission notice shall be included in |