Skip to content

Instantly share code, notes, and snippets.

View he-dev's full-sized avatar
😵
ღ(¯`◕‿◕´¯) ♫ ♪ ♫

ᎬᏁᎶᎥᏁᎬᎬᏒ he-dev

😵
ღ(¯`◕‿◕´¯) ♫ ♪ ♫
  • ƃǝɹɯɐnʎ, ɔoןoƃnǝ
View GitHub Profile
@he-dev
he-dev / README.md
Created April 28, 2023 09:06 — forked from marcelaraujo/README.md
Convert P12 to PEM and extract RSA public and private keys

Convert P12 into PEM

openssl pkcs12 -in google-service-account-key.p12 -nocerts -nodes -out google-service-account-key.pem

openssl pkcs12 -in google-service-account-key.p12 -clcerts -nokeys -out google-service-account-crt.pem

Private RSA key

openssl rsa -in google-service-account-key.pem -out google-service-account-key-rsa

Public RSA key

openssl rsa -in google-service-account-key.pem -out google-service-account-key-rsa.pub -pubout

@he-dev
he-dev / DictionaryJsonConverter
Created March 27, 2018 16:36 — forked from petermorlion/DictionaryJsonConverter
Generic JsonConverter for JSON.NET and IDictionaries
// UPDATE!
// In Json.NET 7, a DictionaryKeyResolver was added.
// This might be able to fix the problem more elegantly.
// I haven't checked though.
public class DictionaryJsonConverter : JsonConverter
{
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var dictionary = (IDictionary)value;
@he-dev
he-dev / repo-reset.md
Created November 19, 2017 13:55 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@he-dev
he-dev / repo-reset.md
Created November 19, 2017 13:55 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
using System;
using System.Collections.Generic;
using System.Linq;
using BenchmarkDotNet.Reports;
using BenchmarkDotNet.Running;
using BenchmarkDotNet.Attributes;
namespace Test {
public class PalindromNumber {
//Thanks to @Velial and @Denis