Skip to content

Instantly share code, notes, and snippets.

View UlisesGascon's full-sized avatar
😎
Focus on FOSS Projects!

Ulises Gascón UlisesGascon

😎
Focus on FOSS Projects!
View GitHub Profile
@UlisesGascon
UlisesGascon / CODE_OF_CONDUCT.md
Last active April 24, 2017 19:30
OSW Repos template

Code of conduct

1. Purpose

A primary goal of Open Source Weekends is to be inclusive to the largest number of contributors, with the most varied and diverse backgrounds possible. As such, we are committed to providing a friendly, safe and welcoming environment for all, regardless of gender, sexual orientation, ability, ethnicity, socioeconomic status, and religion (or lack thereof).

This code of conduct outlines our expectations for all those who participate in our community, as well as the consequences for unacceptable behavior.

We invite all those who participate in Open Source Weekends to help us create safe and positive experiences for everyone.

@UlisesGascon
UlisesGascon / promesas.js
Created April 23, 2017 18:36
Ejemplo de promesas para "Pensar Asícronamente en un mundo síncrono"
var fs = require("fs");
function leerArchivo(nombre) {
return new Promise(function(resolver, rechazar) {
console.log("Empezando la lectura de ", nombre);
fs.readFile(nombre, "utf-8", function(error, contenido) {
if (error) {
console.log("Error en la lectura");
return rechazar(error);
}
@UlisesGascon
UlisesGascon / eventos.js
Created April 23, 2017 18:35
Ejemplo de eventos para "Pensar Asícronamente en un mundo síncrono"
var fs = require("fs");
var events = require('events');
var ee = events.EventEmitter;
var emisorEventos = new ee();
function leerArchivo(nombre) {
console.log("Empezando la lectura de ", nombre);
fs.readFile(nombre, "utf-8", function(error, contenido) {
if (error) {
@UlisesGascon
UlisesGascon / callback.js
Created April 23, 2017 00:29
Ejemplo de eventos para "Pensar Asícronamente en un mundo síncrono"
var fs = require("fs");
fs.readFile("fichero-1.txt", 'utf-8', function(error, contenido) {
console.log(error ? "Error en la lectura" : "Contenido del fichero:", contenido);
});
@UlisesGascon
UlisesGascon / firebase_backup.js
Created April 17, 2017 20:02
Backaup as JSON file any public data available in a Firebase Database
/*
---- In terminal ----
1. npm install [email protected]
2. node firebase_backup database_url
example: node firebase_backup https://docs-examples.firebaseio.com/
*/
var fs = require('fs');
var Firebase = require("firebase")
var ref = new Firebase(process.argv[2]);
@UlisesGascon
UlisesGascon / Kubide_prueba.md
Created April 3, 2017 12:34
Prueba de Kubide

Tu jefe está loco, todos lo sabemos, porque sino, no es lógica la conversación que has tenido esta mañana con él.

Ha llegado con los pelos canosos, largos y revueltos y lo primero que te ha dicho es que tiene una gran idea innovadora: “quiere hacer un muro donde la gente pueda poner frases y que el resto de la gente las pueda ver”. Además de poder “marcar como favoritas las notas/frases” y poder listar las que están marcadas como favoritas.

Y te ha pedido a tí que te encargues de hacer el API del proyecto, es el momento de demostrarle que no eres un gallina!

Te has sentido como marty mcfly en regreso al futuro, y le has preguntado si conocía Twitter, pero él se ha negado a escucharte y ha seguido con lo suyo, así que te has resignado y has conseguido sacarle un listado de historias de usuario.

Como USUARIO quiero poder llamar al API, es decir, quiero poder tener un servidor local al que hacer una llamada HTTP y que me devuelva algo. Como USUARIO quiero poder llamar al API para crear notas.

@UlisesGascon
UlisesGascon / Vincular_nulo_al_pin.js
Created February 21, 2017 17:12
Scripts de After Effects
function vincularNuloAPin (nombre_del_nulo) {
return `fromComp(thisComp.layer("${nombre_del_nulo}").toComp(thisComp.layer("${nombre_del_nulo}").anchorPoint))`;
}
// Ejemplo
vincularNuloAPin ("Rodilla");
@UlisesGascon
UlisesGascon / EMT_lineas_autobuses.js
Created February 8, 2017 10:53
Líneas de autobuses de Madrid (EMT)
/* -- Client Script: ---
http://www.crtm.es/tu-transporte-publico/autobuses-emt/lineas.aspx
-Query vacía-
*/
var lines = []
// Todos menos nocturnos
var busData = document.querySelectorAll("#ContentPlaceHolderDefault_BodyContent_ListadoEMT_16_ListadoLineas > ul a span.aum1")
busData.forEach(function(element){console.log(lines.push(element.textContent))})
@UlisesGascon
UlisesGascon / challenge.md
Last active March 15, 2017 11:13
NASA Rover Challenge

NASA Rover Challenge

Context

The purpose of this test is to enable you to demonstrate your proficiency in solving problems using software engineering tools and processes. Read the specification below and produce a solution.

Your solution should be in the form of completed code. The problem specified below requires a solution that receives input, does some processing and then returns some output.

Specification

A robotic rover is to be landed by NASA on a plateau on Mars. This plateau, which is curiously square, must be navigated by the rover so that its on board cameras can get a complete view of the surrounding terrain to send back to Earth.

@UlisesGascon
UlisesGascon / .eslintrc
Last active November 24, 2016 05:16 — forked from ghostwords/.eslintrc
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"arrowFunctions": false, // enable arrow functions
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"classes": false, // enable classes
"defaultParams": false, // enable default function parameters
"destructuring": false, // enable destructuring