Skip to content

Instantly share code, notes, and snippets.

View codepainkiller's full-sized avatar
🏠
Working from home

Martin Cruz codepainkiller

🏠
Working from home
View GitHub Profile
const request = require('request-promise-native');
const cheerio = require('cheerio');
const scrap = async (url, selector) => {
let html;
try {
html = await request(url);
} catch (err) {
console.error(`Url no encontrada: ${url}`);
return '';
@miguelcperez
miguelcperez / post_tag.sql
Last active March 19, 2018 20:47
Query Posts relacionados por TAG
SELECT c.post_id, c.post_c FROM (
SELECT b.post_id, COUNT(b.post_id) AS post_c FROM(
SELECT post_id, tag_id FROM post_tag
WHERE tag_id IN (SELECT tag_id FROM post_tag WHERE post_id = 1)) AS b
GROUP BY b.post_id
) AS c
WHERE c.post_c >= 2
<?php
namespace App\Http\Requests;
use Illuminate\Http\JsonResponse;
use Illuminate\Validation\ValidationException;
use Illuminate\Contracts\Validation\Validator;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Foundation\Http\FormRequest as LaravelFormRequest;

Neoauto: Nombramiento de clases

Para el nombramiento de clases se utiliza BEM (Bloque, elemento, modificador) en combinación de prefijos que ayudan a identificar el rol del elemento en todo el sitio.

Se siguen los lineamientos de diseño atómico (Atomic design) y la estructura basada en https://github.com/anareyna/atomic-starter

Prefijos a utilizar:

  • e (elemento)

Puede ser un botón, un input, un encabezado. Se repite potencialmente en todo el sitio, no puede dividirse y por lo general se asocia a un tag HTML (button, input, a)

@miguelcperez
miguelcperez / Week6
Last active July 9, 2018 15:04
Mongo for Developers - Homework week 6
Homework 6.1
- Which of the following statements are true about replication in MongoDB? Check all that apply.
* The minimun sensible number of voting nodes to a replica set is three. True
* MongoDB replication is synchronous. False
* By default, using the new MongoClient connection class, w = 1, j = 1. False
* The oplog utilizes a capped collection. True
@knowbody
knowbody / RNfontWeights.js
Created July 14, 2016 13:42
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active February 20, 2024 10:00
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
@RenzoTejada
RenzoTejada / Guía básica para usar ZFTool en ZF2"
Last active September 4, 2016 03:53
Un guía rápida de como usar ZFTool y la ayuda para los developers / desarrolladores / programadores en ZF2
Zend Framework 2 Tool
=========================
**ZFTool** instalar dentro de las dependencias del proyecto Zend Framework 2 .
## Configurar la instalación
* Run `composer require zendframework/zftool:dev-master`
* Habilitar el modulo ZFTool en **application.config.php**
## Features
function delete_current_branch () {
CURR_BRANCH=`git rev-parse --abbrev-ref HEAD`
echo $CURR_BRANCH
if [[ "$CURR_BRANCH" == 'master' ]]; then
echo 'can not delete master branch'
exit 1
fi
@3runoDesign
3runoDesign / Procfile
Last active March 3, 2022 14:09
Deploy Heroku [Laravel 5.2.*]
web: sh app_boot.sh
worker: php artisan queue:listen