Skip to content

Instantly share code, notes, and snippets.

View jrgcubano's full-sized avatar

Jorge Rodríguez Galán jrgcubano

View GitHub Profile
@jrgcubano
jrgcubano / cmder_split.md
Last active October 26, 2018 18:50 — forked from jtferns/cmder_split.md
Create simple 4-way split of Cmder for windows cmd prompting...

Setup

  1. Launch Cmder
  • step1
  1. Right-click on the console tab
  2. Select New Console... to launch the ConEmu console create dialog
  • step2
  1. In the New Console Split section, select the To right radio option click the Start button
  • step3
  1. Congrats, you now have a half-n-half or 50-50 horizontal split!
<!doctype html>
<html>
<head>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
<div aurelia-app="src/configure">
Loading...
@jrgcubano
jrgcubano / app_offline.htm
Created September 19, 2018 08:48 — forked from robert-claypool/app_offline.htm
A simple "app offline" template for ASP.NET
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Offline</title>
</head>
<body style="margin:3em;font-family:sans-serif">
<h2>Offline</h2>
<p>This site is offline for maintenance.</p>
<!--
@jrgcubano
jrgcubano / TableStorageBatchManager
Created September 17, 2018 10:57
Azure Table Storage Batch Manager (Insert, Delete, Merge, etc) in batches
public class TableStorageBatchManager
{
const int BatchSize = 100;
readonly ConcurrentQueue<Tuple<ITableEntity, TableOperation>> operations;
readonly CloudStorageAccount storageAccount;
readonly string tableName;
public TableStorageBatchManager(string tableName)
{
this.tableName = tableName;
@jrgcubano
jrgcubano / Windows10_Setup.md
Created September 7, 2018 03:13 — forked from alanstevens/Windows11_Setup.md
Windows 10 Setup

This guide was created using Microsoft Windows 10 Pro

Version 10.0.17134 Build 17134

Installation

System Updates:

  • Settings -> Update & Security
  • Install all updates

Visual Studio 2017:

@jrgcubano
jrgcubano / get_es_response.cs
Created September 3, 2018 10:08
Get ElasticSearch Response Directly from API
class Program
{
static void Main(string[] args)
{
var counters = getCarparkCounters("1aae8f78-42df-4b72-916e-76e5ab2aa6ac").Hits.HitsHits.Select(c => c.Source);
Save(counters, "carpark-counters");
}
static ElasticSearchResponse getCarparkCounters(string carparkId)
{
@jrgcubano
jrgcubano / TestServerFixture.cs
Created September 1, 2018 18:01 — forked from dealproc/TestServerFixture.cs
Sample Fixture for an owin test server
using Microsoft.Owin.Testing;
using System;
using System.Linq;
using System.Net.Http;
using Xunit;
namespace {Your Project}.Tests.Fixtures {
[CollectionDefinition("Test Server")]
@jrgcubano
jrgcubano / gist:5a972ddfee484b5b3662c994cebe8f50
Created September 1, 2018 17:18 — forked from siacomuzzi/gist:4fa48e32932473348fd2
[AUTH0] ASP.NET Web Api: accept a JWT signed with RS256 algorithm

With Auth0, you can specify the algorithm used to sign your JWT tokens:

So in scenarios when you are signing JWTs with RSRS256 algorithm, you need to perform some changes in your ASP.NET Web Api in order to validate them properly.

NOTE: You can download your .cer file from https://{YOU}.auth0.com/cer endpoint.

ASP.NET Web Api (OWIN)

From app.UseJwtBearerAuthentication method, just replace SymmetricKeyIssuerSecurityTokenProvider with X509CertificateSecurityTokenProvider specifying your public signing key:

@jrgcubano
jrgcubano / example.cs
Created August 31, 2018 12:29
Xunit ES Acceptance Testing with CollectionFixture and Simple Fixture...
[CollectionDefinition(nameof(CarparkDataSourceCollection))]
public class CarparkDataSourceCollection : ICollectionFixture<CarparkDataSourceFixture>
{
// Intentionally left empty as collection fixture marker
}
public class CarparkDataSourceFixture : IDisposable
{
readonly ElasticsearchInside.Elasticsearch _elasticServer;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.