Skip to content

Instantly share code, notes, and snippets.

@marshallswain
marshallswain / express-headers.json
Last active May 5, 2020 05:11
Feathers Client request headers using Socket.io, Express and Primus
{
"accept": "application/json, text/javascript, */*; q=0.01",
"accept-encoding": "gzip, deflate, br",
"accept-language": "en-US,en;q=0.8,cy;q=0.6",
"authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6ImFjY2VzcyJ9.eyJ1c2VySWQiOiI0akZ4SEtQWXRpcnVwMkROIiwiaWF0IjoxNDkxNTM3ODExLCJleHAiOjE0OTE2MjQyMTEsImF1ZCI6Imh0dHBzOi8veW91cmRvbWFpbi5jb20iLCJpc3MiOiJmZWF0aGVycyIsInN1YiI6ImFub255bW91cyJ9.zOqO6bUgQrsMy7JIea6eoDCrMUqnIj2qKE8CPFOvhsQ",
"cache-control": "no-cache",
"connection": "keep-alive",
"content-length": "31",
"content-type": "application/json",
"host": "localhost:3030",
@m-mujica
m-mujica / who-imported.html
Created October 12, 2015 13:58 — forked from matthewp/who-imported.html
Who imported me?
<script src="node_modules/steal/steal.js"></script>
<script>
var oldNormalize = System.normalize;
System.normalize = function(name, parentName){
return oldNormalize.apply(this, arguments).then(function(name){
if(name === "my/module") {
console.log(name, "is imported by", parentName);
}
return name;
});
@justinbmeyer
justinbmeyer / proxies.md
Last active November 18, 2015 02:47
Proxies solve core framework problems.

In short, observables and computed values are something that every framework struggles with. Frameworks that have explicit observables and computed values (Ember, Knockout, CanJS, etc) can provide high performance updates and, imo, a more natural development experience. However, frameworks like Angular and React, that can use plain JS objects, lend themselves to being much more popular, but accomplish "computes" with either unnecessary dirty checking or diffing. Proxies will be able to provide a best of all worlds solutions.

Frameworks with explict observables

Ember, Knockout, CanJS, and many other frameworks have explicit observables and computed values or properties. For example, in CanJS (which I'm most familiar), the following creates a fullName compute that updates whenever any of its source observables change:

@domenic
domenic / 0-github-actions.md
Last active June 6, 2025 08:01
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@matthewp
matthewp / proxy.js
Created September 30, 2014 01:36
Simple proxy in node
var httpProxy = require('http-proxy');
var http = require('http');
var proxy = httpProxy.createProxyServer({});
var server = http.createServer(function(req, res) {
var url = req.url;
console.log(url);
proxy.web(req, res, { target: url });
});
@krasu
krasu / app.js
Created May 31, 2013 21:49
Passport + Node.js / Automatic login after adding user
/**
* Module dependencies.
*/
var express = require('express')
, passport = require('passport')
, http = require('http')
, path = require('path')
, LocalStrategy = require('passport-local').Strategy;
@petehamilton
petehamilton / metric_apps.md
Last active May 22, 2017 19:14
Useful Metric Dashboard Research Links

Dashboards

Charting