Skip to content

Instantly share code, notes, and snippets.

View sourcec0de's full-sized avatar
:octocat:
Focusing

James R Qualls sourcec0de

:octocat:
Focusing
View GitHub Profile

Nutritionix Querying Language (NXQL)

NXQL allows developers to write more advanced queries against our data pool. Examples of what you can do with an advanced query:

  • Filter items by their type (show ONLY USDA items or ONLY CPG items)
  • Filter nutrient ranges (>100 calories AND <500 calories)

All requests are POST and require a valid JSON object be sent to https://api.nutritionix.com/v1_1/search You can paste any of the below JSON examples into this curl request and they will retrieve results assuming you have added your appKey, and appId.

Request Requirements

var cluster = require('cluster');
var http = require('http');
var numCPUs = require('os').cpus().length;
if (cluster.isMaster) {
// Fork workers.
for (var i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('exit', function(worker, code, signal) {

Nutritionix Querying Language (NXQL)

NXQL allows developers to write more advanced queries against our data pool. Examples of what you can do with an advanced query:

  • Filter items by their type (show ONLY USDA items or ONLY CPG items)
  • Filter nutrient ranges (>100 calories AND <500 calories)

All requests are POST and require a valid JSON object be sent to https://api.nutritionix.com/v1_1/search You can paste any of the below JSON examples into this curl request and they will retrieve results assuming you have added your appKey, and appId.

Request Requirements

Nutritionix Querying Language (NXQL)

NXQL allows developers to write more advanced queries against our data pool. Examples of what you can do with an advanced query:

  • Filter items by their type (show ONLY USDA items or ONLY CPG items)
  • Filter nutrient ranges (>100 calories AND <500 calories)

All requests are POST and require a valid JSON object be sent to https://api.nutritionix.com/v1_1/search You can paste any of the below JSON examples into this curl request and they will retrieve results assuming you have added your appKey, and appId.

Request Requirements

var _ = require('underscore'),
rabbit = require('rabbit-pool'),
logging = require('logging')(module);
var exchange,
handlers = {},
messages = [];
/*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(){
var UPC_SET = {
"3211": '0',
"2221": '1',
"2122": '2',
var net = require('net')
var sock = net.connect(1337)
process.stdin.pipe(sock)
sock.pipe(process.stdout)
sock.on('connect', function () {
process.stdin.resume();
process.stdin.setRawMode(true)
@sourcec0de
sourcec0de / nginx.conf
Last active August 29, 2015 14:06 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
type Whatever struct {
someField int
}
func (w Whatever) MarshalJSON() ([]byte, error) {
return json.Marshal(struct{
SomeField int `json:"some_field"`
}{
SomeField: w.someField,
})
#!/bin/bash
sudo apt-get update
sudo apt-get -y install linux-image-extra-$(uname -r)
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\ > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get -y install lxc-docker