Skip to content

Instantly share code, notes, and snippets.

View firminochangani's full-sized avatar

Firmino firminochangani

View GitHub Profile

Keybase proof

I hereby claim:

  • I am flowck on github.
  • I am flowck (https://keybase.io/flowck) on keybase.
  • I have a public key ASDczJTt-l_ZDYZo2LxuG5uRwFFhUv9_xpux6TFILxQg-Ao

To claim this, I am signing this object:

// Dependências
const express = require('express');
const models = require('./models.js');
const routes = require('./routes.js');
// Iniciar o express
const app = express();
// Iniciar a BD
models.openDB();
@firminochangani
firminochangani / loadMoreUsers.js
Last active July 23, 2017 18:02
A snippet from angolan-on-github project.
// Number of users found
this.totalUsers = data.total_count;
// Pagination is the result of total users found devided by
// the number of users listed per request which is 30
this.pagination = Math.round(data.total_count / 30) + 1;
@firminochangani
firminochangani / server.js
Created October 27, 2016 20:08
File Upload works with http but not with https
var fs = require('fs'),
https = require('https'),
express = require('express'),
app = express(),
multer = require('multer');
var storage = multer.diskStorage({
destination: function(req, file, cb) {
cb(null, '/tmp/');
},
@firminochangani
firminochangani / HTTP request raw response
Created May 11, 2016 18:17
The raw response from a GET request on OpenWeatherMap Public API
IncomingMessage {
_readableState:
ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: [],
length: 0,
pipes: null,
pipesCount: 0,
flowing: null,
@firminochangani
firminochangani / Example.js
Created November 1, 2014 20:51
[Keystone.js] Use admin forms outside admin #671
// Model
var keystone = require('keystone'),
Types = keystone.Field.Types;
// Set new model
var Example = new keystone.List('Example', {
nocreate: true
});
// Set the fields of your model