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
class Program | |
{ | |
delegate int del(int i); | |
delegate int[] delArray(int i); | |
delegate int[] delArray2(int[] i); | |
static void Main(string[] args) | |
{ |
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
Set-PSDebug -Off | |
Clear-Host | |
########################################################################################################################## | |
# | |
# Using refresh token to get new access token | |
# The access token is used to access an api by sending the access_token parm with any request. | |
# Access tokens are only valid for about an hour after that you will need to request a new one using your refresh_token | |
# | |
########################################################################################################################## |
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
clear-host; | |
#Remove-Variable * -ErrorAction SilentlyContinue | |
#get-item Variable:* | |
#Get-Variable | Select-Object -ExpandProperty Name | |
. C:\Users\linda_l\Desktop\PowerShell\GoogleOauth.ps1 | |
Add-Type -Path "C:\Users\linda_l\Documents\visual studio 2015\Projects\TestingLibrary\packages\AE.Net.Mail.1.7.10.0\lib\net45\AE.Net.Mail.dll" | |
Add-Type -AssemblyName System.IO | |
Add-Type -AssemblyName System.Text.Encoding |
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
string filepath = @"C:\Users\linda_l\Documents\deleteme.txt"; | |
if (System.IO.File.Exists(filepath.ToString())) | |
{ | |
Google.Apis.Drive.v3.Data.File body = new Google.Apis.Drive.v3.Data.File(); | |
body.Name = System.IO.Path.GetFileName(filepath.ToString()); | |
body.Description = "Test Description"; | |
body.MimeType = "text/plain"; | |
byte[] byteArray = System.IO.File.ReadAllBytes(filepath); | |
System.IO.MemoryStream stream = new System.IO.MemoryStream(byteArray); |
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> | |
/// Lists or searches files. | |
/// Documentation https://developers.google.com/drive/v3/reference/files/list | |
/// Generation Note: This does not always build correctly. Google needs to standardize things I need to figure out which ones are wrong. | |
/// </summary> | |
/// <param name="service">Authenticated Drive service. </param> | |
/// <param name="optional">The optional parameters. </param> | |
/// <returns>FileListResponse</returns> | |
public static Google.Apis.Drive.v3.Data.FileList ListAll(DriveService service, FilesListOptionalParms optional = 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
// Copyright 2016 DAIMTO : www.daimto.com | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with | |
// the License. You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on | |
// an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the | |
// specific language governing permissions and limitations under the License. |
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
private static string UppercaseString(string inputString) | |
{ | |
return inputString.ToUpper(); | |
} | |
delegate string ConvertMethod(string inString); | |
static void Main(string[] args) | |
{ | |
var name = "linda"; |
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 Newtonsoft.Json; | |
using System; | |
using System.Globalization; | |
namespace HttpStuff.Util | |
{ | |
public static class Extensions | |
{ | |
/// <summary> | |
/// Perform a deep Copy of the object, using Json as a serialisation method. |
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> | |
/// Insertion sort example | |
/// | |
/// Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time | |
/// https://en.wikipedia.org/wiki/Insertion_sort | |
/// | |
/// | |
/// OutPut: | |
/// 9 , 8 , 7 , 6 , 5 , 4 , 3 , 2 , 1 , | |
/// 8 , 9 , 7 , 6 , 5 , 4 , 3 , 2 , 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
using Newtonsoft.Json; | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Net; | |
using System.Text; | |
using System.Web; | |
namespace HttpStuff |