- Manipulate (Attract/Repel/Move) (Velocity Manipulation)
- Spin (Angular Velocity Manipulation)
- Compress <--> Expand
#!/bin/sh | |
(env sed --version &> /dev/null || (echo -e "GNU sed not found, attempting to install package:\n";\ | |
(exec 3>&1 4>&2; sed_error=$( { mingw-get install msys-sed 2>&4 1>&3; } 2>&1 ); exec 3>&- 4>&-;\ | |
if ($sed_error); then echo "Could not install GNU sed, aborting.."; exit 1; fi))) && sed_ver_str=\ | |
$(env sed --version) && sed_ver=$(echo $sed_ver_str | sed -n 's/.*version \([0-9\.]*\).*/\1/p') &&\ | |
echo "GNU sed is already installed. (version $sed_ver)" && mingw-get update && PACKAGES=$(mingw-get list\ | |
| sed -ne "s/\(^Package\:\)[[:blank:]]\?\([[:alnum:][:punct:]]\+\).*$/\2\\n/p")\ && echo -en \ | |
"\nInstalling packages:\n\n$(echo $PACKAGES | tr ' ' '\n' | sort -d | pr -3 -atT)\n\n" && echo -en\ | |
"Package Count: $(echo $PACKAGES | tr ' ' '\n' | wc -l -- | tr -d '[:space:]' && echo)\n\n" && read\ | |
-p "Press return to install" -s && mingw-get --verbose=2 install $PACKAGES |
import Fiber from 'fibers'; | |
// Modify express to always spawn a new fibre if none are active. | |
export default function (router) { | |
var oldProcess = router.process_params; | |
if (oldProcess) | |
router.process_params = function(...args) { | |
if (!Fiber.current) | |
Fiber(oldProcess.bind(router, ...args)).run(); | |
else | |
oldProcess.apply(router, args); |
Marty.HttpStateSource.removeHook('parseJSON'); | |
Marty.HttpStateSource.addHook({ | |
id: 'CSRF', | |
priority: 1, | |
before(req) { req.headers['CSRF-Token'] = /* ... obtain a csrf token from somewhere in your application ... */ } | |
}); | |
class Application extends Marty.Application { | |
constructor(options = {}) { |
var startTime = Date.now() | |
var fs = require('fs') | |
var Iconv = require('iconv').Iconv | |
var cluster = require('cluster') | |
var workers; | |
if (cluster.isMaster) workers = [1, 2, 3, 4].map(_ => cluster.fork()) | |
if (!cluster.isMaster) | |
{ |
import { GraphQLSchema } from 'graphql/type'; | |
import { graphql } from 'graphql'; | |
import { type, query, mutation, field, iface, Schema } from '../src'; | |
class MySchema extends Schema { } | |
/** | |
* Declare a basic interface | |
*/ |
import { parse, visit, print } = from 'graphql/language'; | |
/** | |
* Combine the fields of two or more AST nodes, does no error checking! | |
* @param types An array with types to combine. | |
* @returns {*} | |
*/ | |
export function combineASTTypes(types) { | |
return types.reduce((p, n) => Object.assign(p, n, { fields: n.fields.concat(p.fields || []) }), {}); | |
} |
import { visit } from 'graphql/language'; | |
/** | |
* Calls directives with a `resolveStatic` hook at the time of parsing. | |
* @param ast GraphQL schema AST. | |
* @param directives The directives collection. | |
* @param throwOnMissing Should we throw if an unknown directive is encountered? | |
* @returns {*} Revised AST as transformed by the directives. | |
*/ | |
export function applyStaticDirectivesToAST(ast, directives, throwOnMissing = true) { |
const { parse, visit, print, Kind, BREAK } = require('graphql/language'); | |
const { buildASTSchema } = require('graphql/utilities'); | |
const { addResolveFunctionsToSchema } = require('graphql-tools'); | |
const Sequelize = require('sequelize'); | |
const { graphql } = require('graphql'); | |
const jexl = require('jexl'); | |
const deepAssign = require('deep-assign'); | |
const { resolver: sequelizeResolver } = require('graphql-sequelize'); | |
const { inspect } = require('util'); |
To make a GraphQL query on a Vulcan.js server, your server has to connect to itself via a new HTTP connection every time it receives a request.
This package makes it so that Vulcan’s GraphQL queries never leave the process. All GraphQL requests are processed with no overhead.
See also: webtoken-session