Skip to content

Instantly share code, notes, and snippets.

View DanilloCorvalan's full-sized avatar

Danillo Corvalan de Barros DanilloCorvalan

View GitHub Profile
@DanilloCorvalan
DanilloCorvalan / jsbin.dukehe.js
Last active August 29, 2015 14:05
Prototype inheritance and Chain // source http://jsbin.com/dukehe/1
function Person (name, surname) {
this.name = name;
this.surname = surname;
}
Person.prototype.showFullName = function () {
return this.name + ' ' + this.surname;
};
function Employee (name, surname, company) {
this.company = company;
@DanilloCorvalan
DanilloCorvalan / gist:9805138
Created March 27, 2014 11:05
Node test upload file multi part superagent plus supertest
var request = require('supertest');
var fs = require('fs');
var reqData = {
title: 'Rahh!',
fileName: 'test-image.jpeg'
};
var req = request(context.app) //context.app = your express object
.post('/v1/images')
@DanilloCorvalan
DanilloCorvalan / gruntfile.js
Last active August 29, 2015 13:56
gist for stackoverflow question
'use strict';
module.exports = function(grunt) {
// Project Configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
js: {
files: ['gruntfile.js', 'server.js', 'app/**/*.js', 'public/js/**', 'test/**/*.js'],
tasks: ['jshint'],
@DanilloCorvalan
DanilloCorvalan / app.js
Last active December 24, 2015 08:49
Basic express inital main js file
var express = require('express'),
path = require('path'),
home = require('./routes/home.js');
var app = express();
app.configure(function() {
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.static(path.join(__dirname, 'public')));