- What’s required to build it?
- How should it behave?
- What people and computer systems are involved?
- Who are the actors and what are their roles?
- What’s the purpose of this feature?
- What are the use cases?
const mimir = require('mimir'); | |
const brain = require('brain.js'); | |
/* few utils for the example */ | |
// our output is recorded as a vector, where the index in the vector | |
// is the enum (we create it with a zero index). We fill the index in | |
// the array with a 1 and the rest of the items as a 0 (true and false). | |
const vec_result = (res, num_classes) => { | |
const outputVector = new Array(num_classes).fill(0); |
This checklist of Ruby on Rails Security Best Practices focuses on the development side.
Check for Unauthorized Access Authentication Filter Passwords and Other Sensitive Data on Logs Cross Site Request Forgery (CSRF) Strong Parameters Throttling Requests Protecting Your Users Use HTTPS
Lean unit tests with minimal setup
import 'zone.js'; | |
import 'reflect-metadata'; | |
import * as path from 'path'; | |
import * as fs from 'fs'; | |
// import { XMLHttpRequest } from 'xmlhttprequest'; | |
import { JSDOM } from 'jsdom'; | |
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | |
import { ResourceLoader } from '@angular/compiler'; | |
import { AppModule } from './app/app.module'; |
In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.
At the moment GraphQL allows 2 types of queries:
query
mutation
Reference implementation also adds the third type: subscription
. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.
The computer driven markets for instruments like stocks and exchange traded stock options, have transformed finance and the flow of capital. These markets are enabled by order matching engines (and the infrastructure that supports this software). Before computer trading networks and matching engines, stocks where traded on cavernous exchange floors and transaction costs where high. When electronic trading fully matured, floor traders were a fading anachronism and transaction costs had been reduced to pennies a share in many cases. Electronic trading could not exist without advanced network infrastructure, but without the software matching engines no shares would change hands. The computer trading networks, the matching engine software has also created a concentrated nexus of potential failure. Failures in these systems have increased as the frequency and volume on the electronic networks has increased. The position of order matching engines in the trading infrastructure makes these systems o
// simple example of how to achieve more declaritive api calls using middleware in redux like frameworks | |
const apiMiddleare = ({dispatch}) => (next) => (action) => { | |
return (action.type === '[get] api') | |
? fetch(action.payload.url) | |
.then(response => response.json()) | |
.then(json => dispatch({ | |
type: action.payload.success, | |
payload: json | |
})) |
import * as R from 'ramda'; | |
// union and difference are more or less the same except | |
// for the operation performed | |
const abstractSummation = R.curry((operation, a, b) => R.reduce((s, e) => { | |
s[operation](e); | |
return s; | |
}, new Set(a), b)); | |
// for the given sets: | |
// A={2,4,6,8,10} |