Skip to content

Instantly share code, notes, and snippets.

Daniel Rodríguez Rivero danielo515

  • Madrid Spain
Block or report user

Report or block danielo515

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
danielo515 /
Last active Aug 31, 2018
Demonstrate how lab code coverage can get into a promise chain

This is just an example to demonstrate how lab code coverage can get in the way

danielo515 / .travis.yml
Last active Jul 5, 2018 — forked from willprice/.travis.yml
How to set up TravisCI for projects that push back to github
View .travis.yml
language: node_js
cache: yarn
- "8.9.0"
- master
script: # this are lerna-setup related
- npm run npm-setup
- npm run publish -- --yes --skip-git # lerna does not pick the correct repo url, so skip git
danielo515 / travis-ci-git-commit.bash
Created May 26, 2018 — forked from ddgenome/travis-ci-git-commit.bash
Make a commit on a branch in a Travis CI build, dealing with detached HEAD state safely
View travis-ci-git-commit.bash
# function to make a commit on a branch in a Travis CI build
# be sure to avoid creating a Travis CI fork bomb
# see
function travis-branch-commit() {
local head_ref branch_ref
head_ref=$(git rev-parse HEAD)
if [[ $? -ne 0 || ! $head_ref ]]; then
err "failed to get HEAD reference"
return 1
danielo515 / .hyper.js
Created Sep 13, 2017
Issue with npmRegistry
View .hyper.js
module.exports = {
config: {
hyperCommandGifs: {
disabledCommands: [ 'push' ]
npmRegistry: '',
// default font size in pixels for all tabs
fontSize: 12,
danielo515 / create-gh-labels.js
Created Jul 12, 2017
Creates one label on github per package on a lerna repository
View create-gh-labels.js
#!/usr/bin/env node
'use strict';
* This script creates labels at github.
* It depends on github-api and yargs packages, so make sure you have them installed
* on the environment you are going to run this.
* It accepts a github token or a combination of username and password for auth.
* The token can also be provided as an environment variable.
* To display help just run it with the -h or --help flag.
danielo515 / list_packages.js
Created Jul 12, 2017
List all packages under a lerna repository
View list_packages.js
'use strict';
const Fs = require('fs');
const ReadDir = Fs.readdirSync;
const Stat = Fs.statSync;
module.exports = (basePath) => {
const getAllPackages = () => ReadDir(basePath)
.map((d) => `${basePath}/${d}`)
View felicityFail.js
'use strict';
const Urls = ['','','','',''];
const extension = (joi) => ({
base: joi.string(),
name: 'url',
language: {
metrics: 'needs to be one of {{urls}}'
danielo515 / clearEmpties.js
Last active Jun 9, 2017
A function that deletes empty object properties (null or undefined) and also deletes empty objects recursively. It is a small modification from
View clearEmpties.js
function valid(x){
return !( x == null || Number.isNaN(x));
function clearEmpties(o) {
for (const k in o) {
if (!valid(o[k])) {
delete o[k];
if (typeof o[k] !== 'object') {
danielo515 / clearEmpties
Created Jun 8, 2017
A function that deletes empty object properties (null or undefined) and also deletes empty objects recursively.
View clearEmpties
function clearEmpties(o) {
for (const k in o) {
if (o[k] == null) {
delete o[k];
if (typeof o[k] !== 'object') {
danielo515 / axios-set-base-path.js
Last active Apr 29, 2017 — forked from srph/set-base-path.js
axios: Configure the base path with interceptors
View axios-set-base-path.js
var axios = require('axios');
var join = require('url-join');
var isAbsoluteURLRegex = /^(?:\w+:)\/\//;
axios.interceptors.request.use(function(config) {
// Concatenate base path if not an absolute URL
if ( !isAbsoluteURLRegex.test(config.url) ) {
config.url = join('', config.url);
You can’t perform that action at this time.