Skip to content

Instantly share code, notes, and snippets.

@apat
apat / web-scraper-for-hotels.php
Created June 30, 2018 01:58
How to scrap a hotel website related to own website. It is a example code.
<?php
// Mexlike Documentation (Spanish): https://mexlike.io/como-hacer-web-scraping-con-php-simple-html-dom
// Call dependency. Download page: https://sourceforge.net/projects/simplehtmldom/files/
require 'simple_html_dom.php';
// Create DOM from URL or file
$html = file_get_html('https://www.tripadvisor.com/Hotels-g150810-Isla_Mujeres_Yucatan_Peninsula-Hotels.html');
// List of hotels
$wrap_hotels = $html->find('div.prw_meta_hsx_responsive_listing');
@apat
apat / pagination.php
Created February 14, 2015 19:48
Laravel 5 lang en Español | Spanish
<?php
return [
/*
|--------------------------------------------------------------------------
| Pagination Language Lines
|--------------------------------------------------------------------------
|
| The following language lines are used by the paginator library to build
@apat
apat / nav_laravel.blade.php
Last active March 20, 2021 19:50
Menu Navigation Active Class - Laravel 4.x
<!-- Active navigation links to the menu -->
<nav>
<ul>
<!-- First active class -->
<li class="{{ Request::is( '/') ? 'active' : '' }}">
<a href="{{ URL::to( '/') }}">Home</a>
</li>
<li class="{{ Request::is( 'about-us') ? 'active' : '' }}">
<a href="{{ URL::to( 'about-us') }}">About us</a>
</li>
@apat
apat / devise.es.yml
Last active February 12, 2017 00:51
Spanish localization yml for devise gem (version 2.2.4)
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
es:
devise:
confirmations:
confirmed: "Su cuenta ya ha sido confirmada. Por favor, intente ingresar."
send_instructions: "Recibirá un correo electrónico con instrucciones sobre cómo reiniciar su contraseña en unos minutos."
send_paranoid_instructions: "Si su correo electrónico existe en nuestra base de datos, usted recibirá un enlace para reiniciar su contraseña en unos minutos."
failure:
already_authenticated: "Ya está dentro del sistema."