Skip to content

Instantly share code, notes, and snippets.

@rob3c
rob3c / cdk-docker-buildkit-helpers.ts
Last active December 1, 2022 08:52
AWS CDK helpers for asset bundling using Docker BuildKit builds
/**
* This is a placeholder until the CDK fully supports Docker BuildKit builds.
*
* Gist with the latest version: https://gist.github.com/rob3c/8bf845918bc5270c5e22da0674081f90
*
* Open CDK github issue about missing BuildKit support: https://github.com/aws/aws-cdk/issues/14910
*
* Docker BuildKit guide: https://docs.docker.com/develop/develop-images/build_enhancements/
*
* This is a minimal extension based on the CDK source here that's not otherwise extendable:
@rob3c
rob3c / fn-arg-intersection-vs-union-reminder.ts
Last active February 10, 2020 00:37
Clarifying intersection vs union typescript expectations in function parameters
const myFnMap = {
fnA: ({pa}: {pa: string}) => `fnA(${pa})`,
fnB: ({pb}: {pb: string}) => `fnB(${pb})`,
};
type MyFnMap = typeof myFnMap;
// as expected: 'fnA' | 'fnB'
type MyFnKey = keyof MyFnMap;
@rob3c
rob3c / clarity-ng-select.scss
Created November 19, 2019 20:08 — forked from Mennez/clarity-ng-select.scss
This stylesheet allows you to use ng-select in clarity
/**
Clarity (http://clarity.design) (at the moment of writing) does not have an auto-complete/combobox component.
ng-select is currently one of the more popular angular2/4 packages for adding auto-complete components to an angular project.
This style sheet allows anyone to use ng-select in a angular+clarity project that uses clarity forms.
To get these styles applied to your ng-select component, declare your form component as follows:
<form clrForm>
<clr-input-container>
<label>Foo</label>
@rob3c
rob3c / typescript-pattern-matching.ts
Created November 10, 2016 19:13
TypeScript pattern matching proof-of-concept
// preserved from my comment in this issue: https://github.com/Microsoft/TypeScript/issues/165#issuecomment-259598080
interface Type<T> { new(...args): T }
interface CaseResult<R> {
success: boolean;
result: R;
}
interface CaseFn<R> { (value: any): CaseResult<R> }
@rob3c
rob3c / ngrx-remote-devtools-proxy-instructions.md
Last active June 12, 2024 09:17
Using @ngrx/store-devtools remotely with Ionic 2

Ok, I have on-device remote store debugging working with Ionic 2. Unfortunately, time-travel and state import doesn't work with store-devtools yet (see ngrx/store-devtools#33 and ngrx/store-devtools#31), but at least the Inspector, Log Monitor and Graph is working remotely. Here's how:

First, add https://github.com/zalmoxisus/remotedev to the project:

> npm install --save-dev remotedev

Then add these devtools proxy wrapper classes to the project. They provide the same interface as the browser extension so store-devtools will think it's just talking to the chrome extension. I left in the trace debug logging so you can clearly see what's happening in the console, but it's easy to remove if you want.

remote-devtools-proxy.ts

@rob3c
rob3c / vscode_keybindings.json
Created August 29, 2016 22:32
Visual Studio Code (vscode) custom key bindings
// Place your key bindings in this file to overwrite the defaults
[
{ "key": "ctrl+k f", "command": "" }, // avoid accident hitting f instead of h
{ "key": "ctrl+k h", "command": "workbench.action.moveActiveEditorLeft" },
{ "key": "ctrl+k l", "command": "workbench.action.moveActiveEditorRight" },
{ "key": "ctrl+w", "command": "" }, // disable
{ "key": "ctrl+numpad_add", "command": "editor.unfold",
"when": "editorFocus" },
{ "key": "ctrl+numpad_subtract", "command": "editor.fold",
@rob3c
rob3c / vscode_settings.json
Last active August 29, 2023 18:56
Visual Studio Code (vscode) Custom Settings
// Place your settings in this file to overwrite the default settings
{
//-------- Editor configuration --------
"editor.detectIndentation": false,
"editor.fontSize": 12,
"editor.tabSize": 4,
"editor.insertSpaces": true,
"editor.wrappingColumn": 93,
"editor.wrappingIndent": "none",
@rob3c
rob3c / karabiner_private.xml
Last active August 29, 2016 19:19
Karabiner config
<?xml version="1.0"?>
<!-- https://gist.github.com/rob3c/a632bb583eff74b2c6923b91f2a0d385 -->
<root>
<appdef>
<appname>PARALLELS</appname>
<equal>com.parallels.desktop.console</equal>
</appdef>
<devicevendordef>
<vendorname>MACALLY</vendorname>
@rob3c
rob3c / .cvimrc
Last active November 10, 2017 21:04
cVim settings
let blacklists = ["http://localhost/*"]
set autoupdategist
set numerichints
set typelinkhints
map b :buffer<Space>
map d closeTab
map D :exec dJ<CR>
map F createActiveTabbedHint