Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Copia todos los archivos a subdirectorios.
Excepto los que estan en la lista exclude_files
"""
import os
import shutil
import sys
@juanpabloaj
juanpabloaj / slimerjs_script.js
Created November 23, 2014 21:06
slimerjs-script.js
var page = require('webpage').create();
page.open("http://slimerjs.org", function(status){
page.render('screenshots.png');
page.close();
phantom.exit();
});
@juanpabloaj
juanpabloaj / tricks.yaml
Last active August 29, 2015 14:10
run test and flake8 with watchdog
# pip install watchdog nose nose-cov flake8
# watchmedo tricks-from tricks.yaml
tricks:
- watchdog.tricks.ShellCommandTrick:
patterns: ["*.py"]
shell_command: "nosetests --with-cov && flake8 $(find . -name '*.py') --ignore W191"
@juanpabloaj
juanpabloaj / .coveragerc
Created December 11, 2014 18:40
omit site-packages in coverage report
[report]
omit =
*/python?.?/*
*/site-packages/nose/*
*/pypy/*
*/pypy-?.?.?/*
# Logs
logs
*.log
# Runtime data
pids
*.pid
*.seed
# Directory for instrumented libs generated by jscoverage/JSCover
var express = require('express');
var app = express();
var site = express.Router();
var port = process.env.PORT || 8080;
site.use(function(req, res, next){
next();
});
{
"name": "simple-nodejs-express",
"version": "0.1.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "mocha"
},
"author": "juanpabloaj",
"license": "MIT",
describe('GET /api', function(){
it('mensaje de bienvenida en json');
});
var request = require('supertest');
var app = require('../server').app;
var should = require('should');
describe('GET /api', function(){
it('mensaje de bienvenida en json', function(done){
request(app)
.get('/api')
.set('Accept', 'application/json')
.expect('Content-Type', /json/)
@juanpabloaj
juanpabloaj / meetup-js-20150114.md
Last active August 29, 2015 14:13
meetup js 20150114

class: center, middle

Nodejs, mocha y un poco travis-ci


class: center, middle “Un controlador de versiones, testing y esas cosas no son para mi, no tengo tiempo para eso y no trabajo con colaboradores"