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 / apache2.md
Created April 27, 2018 21:51
Install apache2 + php 7 + virtualhost

Apache2 + php7

sudo apt-get install apache2 php libapache2-mod-php

Virtualhost

copy default virtualhost and rename to new virtualhost

@juanpablocs
juanpablocs / post_install.sh
Created April 25, 2018 20:06 — forked from KingsleyOmon-Edo/post_install.sh
Ubuntu post installation script for installing software of your choice.
#!/bin/bash
curl_check ()
{
echo "Checking for curl..."
if command -v curl > /dev/null; then
echo "Detected curl..."
else
echo "Installing curl..."
apt-get install -q -y curl
@juanpablocs
juanpablocs / symfony.md
Last active April 13, 2018 22:24
Quick start symfony new project

Create new Symfony project

install composer project

#with composer
composer create-project symfony/framework-standard-edition mycoolapp

#with symfony standart
symfony new mycoolapp 3.4 
@juanpablocs
juanpablocs / vscode_snippet.md
Last active April 11, 2018 15:36
Snippet for create component react ts for visual studio code.

List snippet available

typing the prefix name and pressing tab will create the code base.

Snippet React ts component function

{
  // Place your snippets for typescriptreact here. Each snippet is defined under a snippet name and has a prefix, body and 
  // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
  // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
@juanpablocs
juanpablocs / eslint.md
Last active April 4, 2018 16:06
Eslint base for react and js good parts

.eslintrc.js

module.exports = {
    "env": {
        "browser": true,
        "node": true,
        "es6": true
    },
    "globals": {
@juanpablocs
juanpablocs / git.md
Last active July 12, 2018 20:29
remove multiple branchs with regex GIT

remove multiples branch with zsh replace UT2 :)

gb -D `gb | grep -E 'UT2*'`

normal

git brand -D `git branch | grep -E 'UT2*'`
@juanpablocs
juanpablocs / css.md
Last active March 7, 2018 20:51
css clean and font simple but beautifiel

code

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
ol,
ul {
  list-style: none;
@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

regex valid js update 2021

const validEmail(str) => !/(\.{2}|-{2}|_{2})/.test(str) && /^[a-z0-9][a-z0-9-_\.]+@([a-z]|[a-z0-9]?[a-z0-9-]+[a-z0-9])\.[a-z0-9]{2,10}(?:\.[a-z]{2,10})?$/.test(str);

validEmail('admin@gmail.com'); //true
validEmail('admin@my-large-domain.news'); //true
validEmail('admin@comercio.com.pe'); //true
validEmail('elonmusk@x.com'); // true (short domain)
validEmail('ud@se.cz'); // true (short domain)