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 / index.html
Created February 28, 2019 09:37 — forked from fkleuver/index.html
Aurelia TypeScript - Popover
<!DOCTYPE html>
<html>
<head>
<title>Aurelia</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.4.6/bluebird.min.js"></script>
</head>
<body aurelia-app="src/main">
/**
* Async iterators simple example.
*
* by Dmitry Soshnikov <[email protected]>
* MIT Style License, 2018
*/
async function* streamChunks() {
yield genChunk(1);
yield genChunk(2);
@jrgcubano
jrgcubano / publickey-git-error.markdown
Created January 28, 2019 11:17 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "[email protected]". Th
@jrgcubano
jrgcubano / search-git-history.md
Created January 2, 2019 09:14 — forked from lyoshenka/search-git-history.md
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@jrgcubano
jrgcubano / .block
Created December 20, 2018 17:54 — forked from donmccurdy/.block
Google Maps + D3 Overlay
license: mit
@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!
@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 / 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 / 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: