Skip to content

Instantly share code, notes, and snippets.

View juanpablocs's full-sized avatar
💭
👨‍💻 Coding..

Juan pablo juanpablocs

💭
👨‍💻 Coding..
View GitHub Profile
@juanpablocs
juanpablocs / docker-front.md
Last active February 23, 2018 21:22
run npm commands from client to docker

Docker and npm

My files

.
├── Dockerfile
└── src
    ├── package.json
    └── task.js
@juanpablocs
juanpablocs / selenium-chrome.md
Last active February 21, 2018 22:44
Install and ready selenium driver for node.js (required node 7+)

Install Chrome driver

wget -N https://chromedriver.storage.googleapis.com/2.29/chromedriver_linux64.zip -P ~/
unzip ~/chromedriver_linux64.zip -d ~/
rm ~/chromedriver_linux64.zip

sudo mv -f ~/chromedriver /usr/local/bin/chromedriver
@juanpablocs
juanpablocs / valid_email.md
Last active March 10, 2021 02:32
SImple Regex for valid email with Javascript

Redux es un almacenador de estados

con redux nuestra aplicación puede trabajar con estados en un solo arbol de datos. Redux trabaja con unos cuantos métodos pero efectivos los cuales son

  • createStore
  • dispatch
  • getState
  • subscribe

un ejemplo básico:

task:

const fs = require('fs');
const param = process.env.page;
const webpackFile = './webpack.config.js';

const msgErr = (msg)=>{
	console.log(msg);
	process.exit();
}

Test promise

describe('unittest', () => {
    test('the data is peanut butter', () => {
        function fetchData(){
            return new Promise((resolve,reject)=>{
                resolve('peanut butter');
            });
        }
 expect.assertions(1);
@juanpablocs
juanpablocs / dir_execute_command.md
Last active October 16, 2017 17:41
access each folder that matches the regex

bash git pull each dir

Execute command:

git_current_branch () {
  #https://stackoverflow.com/a/35298459
  echo $(git branch | grep '^*' | sed 's/* //' )
}
@juanpablocs
juanpablocs / cookie_facebook.sh
Created May 23, 2017 16:52
facebook curl cookie
@juanpablocs
juanpablocs / error-503.php
Created April 3, 2017 21:47
error 503 maintenance correct for seo.
<?php
header( "{$_SERVER['SERVER_PROTOCOL']} 503 Service Unavailable", true, 503 );
header( "Retry-After: 3600" );
?>
<h1>In Maintenance</h1>
@juanpablocs
juanpablocs / webpack2.md
Last active March 31, 2017 19:39
Demo webpack2 integración de Sass y ES6 en español

Webpack 2

Aquí veremos un pequeño ejemplo de como usar webpack2 + babel + sass

instalar dependencias

instalamos dependencias básicas

npm install [email protected] babel-core babel-preset-es2015 node-sass --save-dev