Skip to content

Instantly share code, notes, and snippets.

@lincolnpires
lincolnpires / ghost-jwt-postman.js
Created February 5, 2021 17:28
Postman Pre-request script for Ghost
// Admin API key goes here
const key = pm.environment.get('admin-api-key') || '';
// Split the key into ID and SECRET
const [id, secret] = key.split(':');
console.info('key', key);
// Prepare timestamp in seconds
const currentTimestamp = Math.floor(Date.now() / 1000);
@lincolnpires
lincolnpires / getRandomName.js
Last active December 6, 2020 21:50
Get Random Name JS
function getRandomName() {
const names = [
"Olivia", "Ethan", "Emma", "Ava", "Elijah", "Lucas",
"Charlotte", "Mia", "Harper", "Evelyn", "Liam", "Noah", "Oliver",
"Amelia", "William", "Isabella", "James", "Benjamin", "Sophia",
"Mason", "Mary", "Linc",
];
return names[Math.floor(Math.random() * names.length)];
}
@lincolnpires
lincolnpires / vscode.md
Last active June 18, 2019 18:30
VS Code Setup
@lincolnpires
lincolnpires / JobFactory.cs
Created May 8, 2018 15:53
Quartz.net IJobFactory
using NLog;
using Quartz;
using Quartz.Spi;
using System;
// https://www.quartz-scheduler.net/documentation/quartz-3.x/tutorial/miscellaneous-features.html
// https://quartznet.sourceforge.io/apidoc/3.0/html/?topic=html/9162dc8b-87ee-a10d-38ec-e1f3179851ae.htm
namespace App.Infrastructure
{
public class HttpAction
{
public async Task<HttpResponseMessage> Execute(Uri uri, HttpMethod method, StringContent data = null, string authScheme = null, string authParam = null)
{
HttpRequestMessage httpRequest = GetHttpResponseMessage(uri, method, authScheme, authParam);
if (data != null)
{
httpRequest.Content = data;
}
@lincolnpires
lincolnpires / gitflow.md
Last active November 17, 2017 16:07
Gitflow

Gitflow with raw git commands.

Gitflow process:

  • A develop branch is created from master
  • Feature and release branches are created from develop
  • When a feature is complete it is merged back into the develop branch
  • When the release branch is done it is merged into develop and master
  • A Hotfix branch is created from master
  • When the hotfix is complete it is merged back into develop and master