Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Linda Lawton LindaLawton

🎯
Focusing
Block or report user

Report or block LindaLawton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@LindaLawton
LindaLawton / FileScanner
Last active Apr 20, 2018
Console application for scanning files
View FileScanner
using System;
using System.IO;
using System.Linq;
namespace FileScanner
{
public class Program
{
private const string _locationOfRepoToScan = @"C:\Development\IdentiyServer\IdentityServer4\src\IdentityServer4";
private const string _localDirectoryReplace = @"C:\Development\IdentiyServer\IdentityServer4\";
@LindaLawton
LindaLawton / CloneClient.sql
Last active Apr 19, 2018
Clones a Identtiy Server4 2.0 client. so that you can create a new one.
View CloneClient.sql
-- Instructions:
-- Run this in anohter window
-- SELECT CONVERT(varchar(255), NEWID());
-- Enter values for new client
DECLARE @clientIdGuid AS VARCHAR(100) = '386B5AA0-2045-43B5-8DFE-ECF474F0A3D6';
DECLARE @NEWCLIENTNAME AS VARCHAR(100) = 'Linda Test Client'
Declare @NEW_CLIENT_DESCRIPTION AS VARCHAR(100) = 'Linda Test CLient'
DECLARE @EMAIL_OF_OWNER AS VARCHAR(100) = 'xxxxx@EG.DK';
DECLARE @RedirectUri AS VARCHAR(100) = 'https://daimto.com';
View Daimto.DotnetCore.ConfigFiles.cs
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using System.IO;
namespace Daimto.DotnetCore.ConfigFiles
{
class Program
{
@LindaLawton
LindaLawton / Google Analytics PHP Sample ReadME
Last active Jul 28, 2019
Oauth example for PHP and the Google Analytics reporting api v4 with pagination.
View Google Analytics PHP Sample ReadME
For service account auth include:
require_once __DIR__ . '/ServiceAccount.php';
For Oauth2 include:
require_once __DIR__ . '/Oauth2Authentication.php';
Note: To reset the auth for oauth to just unset the sessions
View MergeSort.java
/**
* Created by Linda Lawton on 6/29/2017.
*/
public class MergeSort {
public static void main(String[] args) throws Exception {
int[] data = new int[]{8, 3, 1, 7, 0};
System.out.print("Before Sort: ");
for (int i = 0; i < data.length; i++) System.out.print( data[i] + ",");
@LindaLawton
LindaLawton / GoogleAnalyticsReportingSample.java
Created Jun 15, 2017
Sample for the Google Analytics reporting API with java
View GoogleAnalyticsReportingSample.java
import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp;
import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver;
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
import com.google.api.client.googleapis.auth.oauth2.GoogleClientSecrets;
import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.json.JsonFactory;
import com.google.api.client.json.jackson2.JacksonFactory;
import com.google.api.client.util.store.DataStoreFactory;
@LindaLawton
LindaLawton / DatabaseDatastore.cs
Created May 11, 2017
Collection of datastores for use with the Google APIs .net Client
View DatabaseDatastore.cs
using Google.Apis.Json;
using Google.Apis.Util.Store;
using System;
using System.Data.Common;
using System.Threading.Tasks;
namespace GoogleAuthDataStores
{
/// <summary>
/// Database data store that implements <see cref="IDataStore"/>. This store creates a different row for each
@LindaLawton
LindaLawton / GoogleFloodBuster.cs
Created Apr 6, 2017
Flood protection class for Google APIs
View GoogleFloodBuster.cs
using System;
namespace GoogleDevTest
{
class Program
{
static void Main(string[] args)
{
// 10 requests within 1 second
var que = new GoogleDevTest.GoogleFloodBuster(new TimeSpan(0, 0, 1), 10);
@LindaLawton
LindaLawton / LogarithmicPeakFinding.cs
Created Mar 23, 2017
logarithmic peak finding solution in C#
View LogarithmicPeakFinding.cs
using System;
namespace CsharpCodeExamples
{
class Program
{
//Peak Finding in C# O(Log N)
//If we take a look at a set of numbers: { 1, 3, 4, 3, 2, 1, 3, 6 }
@LindaLawton
LindaLawton / MatricsRotation.cs
Last active Mar 17, 2017
Rotate a matrix by 90 or 180 degrees
View MatricsRotation.cs
using System;
namespace CsharpCodeExamples
{
class Program
{
static void Main(string[] args)
{
var data = new int[,] { { 1, 1, 1, 1 },
{ 2, 2, 2, 2 },
You can’t perform that action at this time.