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
$database_host = "<host>" | |
$database_name = "<database>" | |
$output_file = "<output_file>" | |
$user = "<username>" | |
$password = "<password>" | |
[system.reflection.assembly]::loadWithPartialName('Microsoft.SqlServer.SMO') | |
$server = new-object "Microsoft.SqlServer.Management.Smo.Server" $database_host | |
$server.connectionContext.loginSecure = $false |
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
internal class JobRegistry :Registry | |
{ | |
public JobRegistry() | |
{ | |
ForSingletonOf<PlaynGO.Common.InversionOfControl.IContainer>().Use<PlaynGO.StructureMap.Container>(); | |
ForSingletonOf<IJobFactory>().Use<WpsJobFactory>(); | |
var col = new NameValueCollection(); | |
ForSingletonOf<ISchedulerFactory>().Use<StdSchedulerFactory>().Ctor<NameValueCollection>("props").Is(ctx => | |
{ |
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
// Open up the NuGet Package Manager in Visual Studio and paste the following line to format every file in the solution. | |
// I'll write a not-so-ugly version later. ;) | |
// BUG! This doesn't recursively grab all files from the project. :( | |
$dte.Solution.Projects | ForEach-Object {$_.ProjectItems | ForEach-Object { if ($_.Name.EndsWith('.cs')) {$window = $_.Open('{7651A701-06E5-11D1-8EBD-00A0C90F26EA}'); if ($window){Write-Host $_.Name;[System.Threading.Thread]::Sleep(100);$window.Activate();$_.Document.DTE.ExecuteCommand('Edit.FormatDocument');$_.Document.DTE.ExecuteCommand('Edit.RemoveAndSort');$window.Close(1);}} }} |
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
/* | |
Call the api client like this: | |
var client = new ApiClient<SEnvelope>("https://baseurl.com/api/v1"); | |
//you would overload and add an auth_token param here | |
client.GetDtoAsync("envelopes", "object_id", (response) => //callback | |
{ | |
this.SEnvelope = response.Data;//should be an envelope from the server | |
}); | |
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
namespace PKI | |
{ | |
class Results : IEquatable<Results> | |
{ | |
internal static readonly Results NotFound = new Results | |
{ | |
Directory = "", | |
KeyName = "" | |
}; |
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
#region Encryption | |
/// <summary> | |
/// Generate a private key | |
/// From : www.chapleau.info/blog/2011/01/06/usingsimplestringkeywithaes256encryptioninc.html | |
/// </summary> | |
private static string GenerateKey(int iKeySize) | |
{ | |
RijndaelManaged aesEncryption = new RijndaelManaged(); | |
aesEncryption.KeySize = iKeySize; | |
aesEncryption.BlockSize = 128; |
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
using System; | |
namespace Hongy | |
{ | |
/// <summary> | |
/// Represents vectorless interval of the form [a, b] or (a, b) or any | |
/// combination of exclusive and inclusive end points. | |
/// </summary> | |
/// <typeparam name="T">Any comparent type</typeparam> | |
/// <remarks> |
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
#Requires -RunAsAdministrator | |
#Requires -Version 3.0 | |
#References: | |
#Getting Started with Nano Server <https://technet.microsoft.com/en-us/library/mt126167.aspx> | |
#Quick Guide - Deploying Nano Server using PowerShell <http://deploymentresearch.com/Research/Post/479/Quick-Guide-Deploying-Nano-Server-using-PowerShell> | |
param ( | |
#[ValidateScript({ Test-Path $_ })] | |
$ConvertWindowsImageScriptPath = 'D:\work\NanoServerSetup\Convert-WindowsImage.ps1' |
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
/* | |
Student Planning goes down randomly and we have to recycle the app pool to fix it. | |
This script will try to login to Student Planning and make an AJAX request. It will | |
return text output (console.log() output) about whether it is working or not. | |
NOTE: this script relies on PhatomJS, which you can download here: | |
http://phantomjs.org/download.html | |
NOTE: change the values of the host, user, and pass variables. Optionally change the timeout variable. | |
*/ |
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 ReportServer | |
go | |
/* Performance Tips | |
1. High TimeDataRetriveal | |
* Removed unused datasets | |
* Analyze the dataset query in SQL Profiler | |
* Combine Datasets where possible | |
2. High TimeProcessing | |
* Use less report parts (tables, charts...) | |
* Do Grouping and Sorting on the SQL Side |
OlderNewer