Instantly share code, notes, and snippets.

View typescript-pattern-matching.ts
// 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> }
View ngrx-remote-devtools-proxy-instructions.md

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 https://github.com/ngrx/store-devtools/issues/33 and https://github.com/ngrx/store-devtools/issues/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

View vscode_keybindings.json
// 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",
View vscode_settings.json
// 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",
View karabiner_private.xml
<?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>
View .cvimrc
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