Creates a Post <-> Tag association

@param {Object} body
@param {Function} cb
773455
function create(body, cb) {
  var validates = Schema(body);

  if(!validates) {
    return cb(new exceptions.BadRequest());
  }

  db.getClient(function(err, client, done) {
    client.query(INSERT, [body.post_id, body.tag_id], function(err, r) {
      if(err) {
        cb(err);
        done(err);
      } else {
        cb(null, r.rows[0]);
        done();
      }
    });
  });
}
1364544
function create_content (body) {
      var meta = create_meta_info(body.meta_title, body.meta_description, body.meta_sort);
      return meta + body.content;
    }
730384
function create(body, cb) {
  var validates = Schema(body);

  if(!validates) {
    return cb(new exceptions.BadRequest());
  }

  crypto.encode(body.password, function(err, encoded) {
    if(err) { return cb(err); }

    body.password = encoded;
    body.created_at = new Date();

    var q = qb.insert(body);
    db.getClient(function(err, client, done) {
      client.query(q[0], q[1], function(err, r) {
        if(err) {
          if(err.code == 23505) {
            err = new exceptions.AlreadyExists();
          }
          cb(err);
          done(err);
        } else {
          cb(null, r.rows[0]);
          done();
        }
      });
    });
  });
}
289130
function putDB(cb) {
    request.put({url: db_url}, function(error, response, body) {
      if (error) {
        console.log("Error creating DB: " + error);
      } else {
        cb();
      }
    });
  }
335372
function _handleTags(username, tags, cb) {
    var self = this;

    self.userData = tags;
    self.userData.username = username;
    self.userData.special = [];

    if (typeof tags['emotes'] === 'string') {
        var emoticons = tags['emotes'].split('/');
        var emotes = {};

        for (var i = 0; i < emoticons.length; i++) {
            var parts = emoticons[i].split(':');
            emotes[parts[0]] = parts[1].split(',');
        }
        self.userData.emote = emotes;
    }

    if (tags['subscriber'] === '1') { self.userData.special.push('subscriber'); }
    if (tags['turbo'] === '1') { self.userData.special.push('turbo'); }
    if (typeof tags['user_type'] === 'string') { self.userData.special.push(tags['user_type']); }

    if (typeof cb == "function") {
        return cb(self.userData);
    }
}
1053747
function createCttEntity(id, html, cb) {

    let state = null
    let messages = []

    try {
        html = htmlBeautify(html)
        let $ = parser.load(html)

        let table = $('table.full-width tr').get(1).children.filter(e => e.type == 'tag')

        let dayAndHours = table[2].children[0].data.trim() + ' ' + table[3].children[0].data.trim()
        state = {
            date: moment.tz(dayAndHours, "YYYY/MM/DD HH:mm", zone).format()
        }

        if(table[4].children.length == 0) {
            state['status'] = 'Sem estado'
        } else {
            if(table[4].children[0].data) {
                state['status'] = table[4].children[0].data.trim()
            } else {
                state['status'] = table[4].children[0].children[0].data.trim()
            }
        }

        let details = $('#details_0').find('tr')

        let day = ""
        let dayUnformated = ""
        let message = {}
        for(let i = 0; i < details.length; i++) {
            let tr = details.get(i)
            if(tr.children.length >= 8){
                let idxsum = 0

                if(tr.children.length >= 9) {
                    day = tr.children[0].children[0].data.trim()
                    dayUnformated = day.split(',')[1].trim()
                    day = moment.tz(dayUnformated, "DD MMMM YYYY", 'pt', zone).format()
                    message = {
                        day: day,
                        status: []
                    }
                    messages.push(message)
                    idxsum = 1
                }

                let hours = tr.children[0+idxsum].children[0].data.trim()
                let time = moment.tz(dayUnformated + ' ' + hours, "DD MMMM YYYY HH:mm", 'pt', zone).format()
                let add = {
                    time: time,
                    status: tr.children[2+idxsum].children[0].data.trim(),
                    local: tr.children[6+idxsum].children[0].data.trim()
                }
                message.status.push(add)
            }
        }

    } catch (error) {
        return cb(error)
    }

    cb(null, new CttInfo(id, state, messages))

}
212078
function createARecord (domain, subdomain, ip, cb) {
        var body = {
            name: subdomain,
            type: 'A',
            content: ip
        };
        _hoverRequest('POST', '/domains/' + domain + '/dns', body, cb);
    }
1043202
public static String post(String url, String body) {
        ExceptionUtil.notNull(url);
        return post(url, null, null, null, body, false);
    }
527146
function doWork(cb) {
  async.series([
    async.apply(deleteTags),
    async.apply(createTag)
  ], cb);
}
1116008
function createEvent(params, cb) {
  params.resourcePath = config.addURIParams(constants.EVENTS_BASE_PATH, params);
  params.method = 'POST';
  params.data = params.data || {};
  mbaasRequest.admin(params, cb);
}
195519
function (url, formData, cb) {

            request.post({url: url, formData: formData}, function (error, response, body) {

                if (error) {
                    return cb(error);
                }

                if (response.statusCode == 200 || response.statusCode == 201) {

                    return cb(null, body);

                } else {

                    return cb(new Error('Server responded with error: ' + response.statusCode));

                }

            })

        }
111736
def create_body(action, params):
        """"""
        body = {}
        body['action'] = action
        if params is not None:
            body['params'] = params
        return body
353523
function createUser (params, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      const { id, name, organizationId, metadata } = params

      Joi.validate({ id, name, organizationId }, validationRules.createUser, function (err) {
        if (err) return cb(Boom.badRequest(err))

        userOps.organizationExists(organizationId, (err, res) => {
          if (err) return cb(err)
          if (!res) return cb(Boom.badRequest(`Organization '${organizationId}' does not exist`))

          userOps.insertUser(db, { id, name, organizationId, metadata }, (err, result) => {
            if (err) return cb(err)

            userOps.readUser({ id: result.rows[0].id, organizationId }, utils.boomErrorWrapper(cb))
          })
        })
      })

      return promise
    }
755816
function obtainInfo(action, id, cb) {
    request.post({
        url: action,
        form: {
            trackingNo03: id
        },
        timeout: 20000
    }, function (error, response, body) {
        if (error || response.statusCode != 200) {
            cb(utils.errorDown())
            return
        }

        // Not found
        if (body.indexOf('Please insert the correct Tracking Number.') != -1) {
            cb(utils.errorNoData())
            return
        }

        let entity = null
        try {
            entity = createMalaysiaPosEntity(body)
        } catch (error) {
            return cb(utils.errorParser(id, error.message))
        }

        cb(null, entity)
    })
}
619949
function make_request(params, cb) {

  var options =
  { uri: params.uri
  , method: params.method
  , headers: params.headers
  }

  if (params.body) options.body = params.body
  else options.headers['content-length'] = 0

  debug("making request", options)
  request.make(options, function (error, response, body) {
    cb(error, response)
  })
}
1213897
function createTag(cb) {
  var newTagName = 'v1.0.0';

  async.series([
      async.apply(git.tag, {tag: newTagName, message: newTagName + ' release', annotated: true}),
      async.apply(git.push, {tag: newTagName, remote: remote})
  ], cb);
}
1102349
function parseHttpBody(req, cb) {
	// check for multipart streams that can contain file uploads

	var contentType = req.headers['content-type'];
	var m = contentType && contentType.match(/^multipart\/form-data; boundary=(.+)$/);

	if (m && m[1]) {
		parseMultipart(req, m[1], cb);
	} else {
		parseSinglepart(req, cb);
	}
}