git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The use cases for Monoids & Semigroups are pretty similar | |
// Not every Semigroup can be a Monoid, e.g. when there is no neutral value for empty | |
// An example use case for both Semigroups & Monoids | |
// We merge two objects together we merge them by always using the right-most non-None value | |
// We do this by using the getLastMonoid function from fp-ts | |
// Mostly taken from https://dev.to/gcanti/getting-started-with-fp-ts-monoid-ja0 | |
import { getStructMonoid } from "fp-ts/lib/Monoid"; | |
import { Option } from "fp-ts/lib/Option"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A collection of static utility methods for unit testing. | |
*/ | |
@IsTest | |
public class TestUtil { | |
// ID generator configuration | |
private static final Integer ID_RESERVED_CHARACTERS = 7; | |
private static final Integer ID_INCREMENTER_PREFIX_LENGTH = 1; | |
private static final String BASE62_ALPHABET = '0123456789abcdefghijklmnopqrstuvwqyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as jsc from 'jsverify'; | |
const getRandomString = (length: number, chars: string) => { | |
let result = ''; | |
for (let i = length; i > 0; --i) { | |
result += chars[Math.floor(Math.random() * chars.length)]; | |
} | |
return result; | |
}; |
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:
- It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
- It is free, with no quotas.
- Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem | |
rem **************************************************************************** | |
rem | |
rem Copyright (c) Microsoft Corporation. All rights reserved. | |
rem This code is licensed under the Microsoft Public License. | |
rem THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF | |
rem ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY | |
rem IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR | |
rem PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. |