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
// 1x1 transparent GIF | |
private readonly byte[] GifData = { | |
0x47, 0x49, 0x46, 0x38, 0x39, 0x61, | |
0x01, 0x00, 0x01, 0x00, 0x80, 0xff, | |
0x00, 0xff, 0xff, 0xff, 0x00, 0x00, | |
0x00, 0x2c, 0x00, 0x00, 0x00, 0x00, | |
0x01, 0x00, 0x01, 0x00, 0x00, 0x02, | |
0x02, 0x44, 0x01, 0x00, 0x3b | |
}; |
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
var regex = new Regex(@"((\?|\&)?utm(.*$))"); | |
urlLimpa = regex.Replace(urlLimpa, string.Empty); |
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
var baseUrl = location.href.split('?')[0]; |
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.Collections.Generic; | |
using System.Text; | |
using System.Net; | |
using System.Collections.Specialized; | |
using System.IO; | |
using System.Web; | |
using System.Configuration; | |
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
MailMessage mailMsg = new MailMessage(); | |
// To | |
mailMsg.To.Add(new MailAddress("to@example.com", "To Name")); | |
// From | |
mailMsg.From = new MailAddress("from@example.com", "From Name"); | |
// Subject | |
mailMsg.Subject = "subject"; | |
//Texto |
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
CREATE FUNCTION Captalize( @InputString varchar(max)) | |
RETURNS varchar(max) | |
AS | |
BEGIN | |
DECLARE @Index INT | |
DECLARE @Char CHAR(1) | |
DECLARE @PrevChar CHAR(1) | |
DECLARE @OutputString VARCHAR(max) |
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
public static System.Drawing.Image PadImage(System.Drawing.Image originalImage) | |
{ | |
int largestDimension = Math.Max(originalImage.Height, originalImage.Width); | |
int h = originalImage.Size.Height; | |
int w = originalImage.Size.Width; | |
int final = 0; | |
if (w >= h) | |
final = h; | |
else |
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
public Image ConvertBytesToImage(byte[] byteArray) | |
{ | |
MemoryStream ms = new MemoryStream(byteArray); | |
Image imagemRetorno = Image.FromStream(ms); | |
return imagemRetorno; | |
} |
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
public byte[] ConvertImageToBytes(Image imageToConvert, System.Drawing.Imaging.ImageFormat formatOfImage) | |
{ | |
byte[] ret; | |
try | |
{ | |
using (var ms = new MemoryStream()) | |
{ | |
imageToConvert.Save(ms, formatOfImage); | |
ret = ms.ToArray(); | |
} |
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 -Path "C:\Program Files (x86)\AWS SDK for .NET\bin\AWSSDK.dll" | |
$secretKeyID="secret key" | |
$secretAccessKeyID="access key" | |
$bucket="BucketName" | |
$backup_directory="C:\teste" | |
$new_folder_format = Get-Date -uformat "Backup_%Y_%m_%d/" | |
foreach($file in Get-ChildItem -Path $backup_directory){ |
OlderNewer