Skip to content

Instantly share code, notes, and snippets.

View JakeGinnivan's full-sized avatar
:shipit:

Jake Ginnivan JakeGinnivan

:shipit:
View GitHub Profile
void Main()
{
var configurationStore = new ConfigurationStore(new TypeMapFactory(), MapperRegistry.Mappers);
var mapper = new MappingEngine(configurationStore);
var server = new Server();
configurationStore
.CreateMap<From, To>()
.ForMember(d => d.ServerThing, m => m.ResolveUsing(new FromServer1Resolver(server)).FromMember(s => s.ServerThingId))
@JakeGinnivan
JakeGinnivan / gitflow-overview.puml
Last active November 10, 2023 20:52
Overview of GitFlow and versions generated by GitVersion
@startuml
participant "pull/2/merge" as feature
participant develop
participant "release/2.0.0" as majorRelease
participant "release/1.3.0" as minorRelease
participant master
activate develop
activate master
master -> master: commit
master -> master: tag 1.2.0
public class DelegateCommand : DelegateCommand<object>
{
public DelegateCommand(Action executeMethod)
: base(o => executeMethod())
{
}
public DelegateCommand(Action executeMethod, Func<bool> canExecuteMethod)
: base(o => executeMethod(), o => canExecuteMethod())
{
@JakeGinnivan
JakeGinnivan / Pulumi.yaml
Last active January 12, 2023 10:17
Pulumi /w TypeScript project references + dynamodb lock
name: serverless-mono
description: Serverless mono infrastructure
backend:
url: s3://my-pulumi-state-bucket
runtime:
name: nodejs
options:
typescript: false
lock:
region: ap-southeast-2
"omnisharp.enableImportCompletion": true,
"omnisharp.enableRoslynAnalyzers": true,
"omnisharp.organizeImportsOnFormat": true,

Then https://github.com/nx-dotnet/nx-dotnet. Use NX to manage the mono repo and the .net (and other languages) of projects.

Can then pnpm nx run-many --target=build --all to build all projects, .net or otherwise.

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Windows]
"ErrorMode"="2"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting]
"DontShowUI"="1"
`<script>window.data = ${serialize(store.getState())}</script>`
class SomethingComponent extends React.Component {
componentWillMount() {
// If we don't have an article, load it
if (!this.props.article) {
this.props.dispatch(loadArticle(this.props.id))
}
}
render() {
if (this.props.loading) {
// Note, doesn't deal with timeouts, infinite recursion, errors etc..
async function resolveAll(render, promiseTracker) {
const renderResult = render(promiseTracker)
if (promiseTracker.hasWork) {
await promiseTracker.waitForCompletion()
return resolveAll(render, promiseTracker)
}
return renderResult
}
function dispatch(action) {
// Promise tracker middleware
const nextAction = reduxThunkMiddleware(action)
// Because react-thunk returns the result of the
// thunk, our async function returns a promise
// Which means this statement will be true
if (Promise.resolve(nextAction) === nextAction) {
// Tracking a promise is a side effect of our middleware
track(nextAction)