Skip to content

Instantly share code, notes, and snippets.

@peterreisz
peterreisz / index.js
Last active May 30, 2024 10:00
Dev server proxy for stencil. Backend is running on port 3000, stencil on 3333, open port 5000 for development. Only `/api` requests are sent to the backend, everything else served by stencil.
const http = require('http');
const httpProxy = require('http-proxy');
const proxyApi = new httpProxy.createProxyServer({
target: {
host: '127.0.0.1',
port: 3000
}
});
proxyApi.on('error', () => {});
@peterreisz
peterreisz / gist:1e4f8c41d68d23060b0ec4650916c17e
Last active July 4, 2016 07:32
Detect angularjs 1.x unused injected dependencies
function u(i) {
var s = 'function fn'+ i.substring(9),
i = s.indexOf('('),
j = s.indexOf(')');
return eslint.verify(s, {
rules: {
'no-unused-vars': [
'error', {
vars: 'all',