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
package com.mao.jaxb.util; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.lang.annotation.Annotation; | |
import java.lang.reflect.Type; | |
import javax.ws.rs.WebApplicationException; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.MultivaluedMap; |
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
/// <summary> | |
/// Adapted from: | |
/// http://www.codeproject.com/Articles/5719/Simple-encrypting-and-decrypting-data-in-C | |
/// </summary> | |
public class EncryptionService : IEncryptionService | |
{ | |
private readonly string _password; | |
private readonly byte[] _salt; | |
public EncryptionService( string password, string salt ) |
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
using System; | |
using System.IO; | |
using Newtonsoft.Json.Linq; | |
namespace JsonToEntity | |
{ | |
public static class EntityDbLoader | |
{ | |
public static int SaveJsonToDatabase<T>( this IDbContext dbContext, string jsonPath, Func<dynamic, T> mappingFunction, int? batchSize = 200 ) where T : class | |
{ |
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-ChildItem "." -Filter *.exe | Select-Object -Property VersionInfo | ConvertTo-Json > assemblyversions.json |
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
SELECT | |
ja.job_id, | |
j.name AS job_name, | |
ja.start_execution_date, | |
ISNULL(last_executed_step_id,0)+1 AS current_executed_step_id, | |
Js.step_name | |
FROM msdb.dbo.sysjobactivity ja | |
LEFT JOIN msdb.dbo.sysjobhistory jh | |
ON ja.job_history_id = jh.instance_id | |
JOIN msdb.dbo.sysjobs j |
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
##################################################################### | |
# New-SelfSignedCertificateEx.ps1 | |
# Version 1.0 | |
# | |
# Creates self-signed certificate. This tool is a base replacement | |
# for deprecated makecert.exe | |
# | |
# Vadims Podans (c) 2013 | |
# http://en-us.sysadmins.lv/ | |
##################################################################### |
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 Export-WorksheetToCSV | |
{ | |
<# | |
.Synopsis | |
This cmdlet converts .xlsx files to .csv. | |
.Description | |
This cmdlet uses COM to open XLSX and then saves every tab as a separate CSV file. This only works if the | |
individual tab CAN be converted to CSV. |