Skip to content

Instantly share code, notes, and snippets.

View marta-krzyk-dev's full-sized avatar
Focusing

Marta Krzyk marta-krzyk-dev

Focusing
View GitHub Profile
@marta-krzyk-dev
marta-krzyk-dev / CryptographyKeyFormats.txt
Last active January 22, 2019 08:20
What do popular key formats in cryptography start and end with?
1. Pkcs8PrivateBlob - PKCS #8 is a standard syntax for storing private key information. PKCS #8 is one of the family of standards called Public-Key Cryptography Standards (PKCS).
The PKCS #8 private key may be encrypted with a passphrase using the PKCS #5 standards, which supports multiple ciphers.
PKCS #8 private keys are typically exchanged in the PEM base64-encoded format.
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
-----BEGIN ENCRYPTED PRIVATE KEY-----
-----END ENCRYPTED PRIVATE KEY-----
@marta-krzyk-dev
marta-krzyk-dev / ClickableImageArea.html
Last active January 22, 2019 08:47
Clickable area of image inside email
<!--This solution doesn't work with Gmail, worked in Thunderbird.-->
<img src="http://yoursite.eu/image.jpg" usemap="#image-map">
<map name="image-map">
<area target="_blank" href="http://yoursite.eu/check_this_link_out" coords="184,839,435,879" shape="rect">
</map>
@marta-krzyk-dev
marta-krzyk-dev / Useful keyboard shortcuts.txt
Created January 22, 2019 10:26
Useful keyboard shortcuts
Ctrl + K, Ctrl + \ Delete horizontal white space in selected string.
@marta-krzyk-dev
marta-krzyk-dev / 1.png
Last active February 12, 2019 14:02
How to save unfinished changes on many shelves in Tortoise Hg?
1.png
@marta-krzyk-dev
marta-krzyk-dev / Union VS Union All.sql
Created February 21, 2019 10:40
SQL: UNION vs UNION ALL
--UNION ALL allows duplicates, whereas UNION does not (returns only distinct rows)
SELECT CustomerName FROM orders
UNION
SELECT CustomerName FROM customers;
--Result:
--Mary
--John
--Bill
@marta-krzyk-dev
marta-krzyk-dev / DuplicatedJsonProperties.cs
Last active March 16, 2019 09:42
How to detect/ignore duplicated properties in JSON
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace DuplicatedJsonProperties
{
class DuplicatedJsonProperties
{
private const string data =
@"{
@marta-krzyk-dev
marta-krzyk-dev / RemoveFolders.cs
Last active April 5, 2019 08:51
Remove all subfolders with given name within a folder
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace RemoveFolders
{
class Program
{
private const string exitCode = "0";
@marta-krzyk-dev
marta-krzyk-dev / UpgradeFrameworkInProjects.cs
Last active April 17, 2019 21:02
Upgrade .NET Framework version in all projects at once
using System;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace UpgradeFrameworkInProjects
{
class Program
{
private const string exitCode = "0";
@marta-krzyk-dev
marta-krzyk-dev / nodeJsRequest.js
Created April 21, 2019 19:32
Node JS handler
_some_handler.post = function(data, callback){
var reqDetails = {}; //Some details
var reqData = {}; //Some data
var req = https.request(reqDetails, function(res){
if(200 == res.statusCode) {
callback(200, {'Message' : 'Success'});
} else {
@marta-krzyk-dev
marta-krzyk-dev / Promises.js
Last active April 27, 2019 20:48
Promises all and race in JS
//From: https://www.youtube.com/watch?v=s6SH72uAn3Q
{ //Declare scope
let cleanRoom = function(message) {
return new Promise(function(resolve, reject) {
resolve(message + ' I cleaned the room!');
});
};