Skip to content

Instantly share code, notes, and snippets.

View juristr's full-sized avatar

Juri Strumpflohner juristr

View GitHub Profile
const { createProjectGraphAsync } = require('@nx/devkit');
const projectName = 'reactapp1'; // <<<< change this to your app name or parameterize
createProjectGraphAsync().then((projectGraph) => {
const project = projectGraph.nodes[projectName];
if (!project) {
throw new Error(`Project '${projectName}' not found in the workspace.`);
}
...
[alias]
rb = !sh -c 'node ~/bin/recbranch.js'
...
/*
# Markdown Journal
- Creates a new markdown file based on the day (or opens existing file)
- Opens the file in the built-in editor
- Adds a timestamp
- Auto-saves as you type
- On first run, will prompt the user to select where to store files
*/
// Name: Journal
import {
formatFiles,
getProjects,
logger,
Tree,
updateProjectConfiguration
} from '@nrwl/devkit';
/**
* Angular Material relies on the projects to have either a build target
@juristr
juristr / launch.json
Created May 12, 2020 20:35
VSCode launch utils
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest All",
@juristr
juristr / README.md
Created January 21, 2020 13:38
Generate empty node app with Nx

You could generate an empty workspace like

$ npx create-nx-workspace expresswrkspace

and choose "empty" when being asked for a preset.

Then add node support with

@juristr
juristr / uses.md
Last active August 29, 2022 13:08
juri uses

How I setup my computer

Here's the things I usually install on my computer (currently a Macbook Pro 16")

MacOS customization

Here are some of the defaults I usually customize.

  • Configure trackpad
  • click with tap
@juristr
juristr / mutation-observer.ts
Created September 5, 2019 12:16
rxjs toolbox
// https://twitter.com/niklas_wortmann/status/1167361268732370944
const observeOnMutation = (target, config): Observable<MutationRecord[]> => {
return new Observable((observer) => {
const mutation = new MutationObserver((mutaitons, instance) => {
observer.next(mutations);
});
mutation.observe(target, config);
const teardown = () => {
@juristr
juristr / FileOpener2.java
Last active September 3, 2018 08:47
patch of FileOpener2.java
/*
The MIT License (MIT)
Copyright (c) 2013 pwlin - pwlin05@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
@juristr
juristr / index.html
Created June 27, 2018 12:58
Geolocation tests
<html>
<body>
<button id="gpsStart">Start</button>
<button id="gpsStop">Stop</button>
<button id="checkStatus">Status</button>
<div id="log"></div>
<script>
(function () {
var old = console.log;