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 Google.Apis.Auth.OAuth2; | |
using Google.Apis.Gmail.v1; | |
using Google.Apis.Gmail.v1.Data; | |
using Google.Apis.Services; | |
using Google.Apis.Util.Store; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Text; |
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
///<summary> | |
/// Decode Base64 encoded string with URL and Filename Safe Alphabet using UTF-8. | |
///</summary> | |
///<param name="str">Base64 code</param> | |
///<returns>The decoded string.</returns> | |
public static string DecodeBase64(string str) | |
{ | |
if (str == null) | |
return str; | |
int padChars = (str.Length % 4) == 0 ? 0 : (4 - (str.Length % 4)); |
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
// Define parameters of request. | |
var request = service.Users.Messages.List("me"); | |
IList<Message> messages = request.Execute().Messages; | |
Console.WriteLine("Messages:"); | |
if (messages != null && messages.Count > 0) | |
{ | |
foreach (var message in messages) | |
{ | |
var messageReq = service.Users.Messages.Get("me", message.Id); |
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
{ | |
"isSpammyLookingEmailMessage": false, | |
"isSpammyLookingSender": false, | |
"isSpam": false, | |
"from_LastName": "Gates", | |
"from_FirstName": "Bill", | |
"from_Fax": null, | |
"from_Phone": null, | |
"from_Address": null, | |
"from_Title": null, |
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
{ | |
"subject": "Thanks for meeting...", | |
"from_address": "[email protected]", | |
"from_name": "Bill Gates", | |
"htmlbody": "<div>Hi, good seeing you the other day.</div><div>--</div><div>Bill Gates</div><div>Cell 777-444-8888</div><a href=\"https://www.linkedin.com/in/williamhgates/\">LinkedIn</a><a href=\"https://twitter.com/BillGates\">Twitter</a>", | |
"plainbody": "Hi, good seeing you the other day. \r\n--\r\nBill Gates\r\nCell 777-444-8888", | |
"date": "2017-01-01T00:00:00" | |
} |
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
public static DbConnection GetCenterConnection(IConfig config = null) | |
{ | |
return new DragnetTech.Shared.Tracing.Npgsql.NpgsqlConnection(new Npgsql.NpgsqlConnection(Config.GetConnectionStringCenterDB()), Tracing.AWSIDbProfiler.Instance); | |
} |
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
/// <summary> | |
/// This must be called NpgsqlConnection for Dapper to detect the connection as being an NpgsqlConnection. | |
/// Otherwise Dapper doesn't handle arrays correctly for Postgresql connections. | |
/// </summary> | |
public class NpgsqlConnection : StackExchange.Profiling.Data.ProfiledDbConnection | |
{ | |
public NpgsqlConnection(DbConnection connection, IDbProfiler profiler) : base(connection, profiler) | |
{ |
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
SELECT 'public ' || | |
case | |
when data_type = 'uuid' THEN 'Guid' | |
when data_type = 'text' then 'string' | |
when data_type = 'json' then 'string' | |
when data_type = 'integer' then 'int' | |
when data_type = 'boolean' then 'bool' | |
when data_type = 'bigint' then 'long' | |
when data_type = 'timestamp with time zone' then 'DateTimeOffset' | |
when data_type = 'timestamp without time zone' then 'DateTime' |
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
Guid _UserID = Guid.Empty; | |
public Guid UserID { get { return _UserID;} set { _isDirty = true; _UserID = value; } } | |
string _EmailAddress = null; | |
public string EmailAddress { get { return _EmailAddress;} set { _isDirty = true; _EmailAddress = value; } } | |
string _Name = null; | |
public string Name { get { return _Name;} set { _isDirty = true; _Name = value; } } | |
int _TimesFound = 0; | |
public int TimesFound { get { return _TimesFound;} set { _isDirty = true; _TimesFound = value; } } |
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
// | |
// Loggly.swift | |
// mobile | |
// | |
// Created by Paul Mendoza | |
// Twitter: PaulDMendoza | |
// | |
import Foundation | |
import UIKit |