This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$regexES = "/^((0034|\+34|34){1})*(?(?=6)(6){1}[0-9]{8}|(7){1}[1-9]{1}[0-9]{7})$/"; | |
$regexFR = "/^((0033|\+33|33){1})*(?(?=0)(06|07){1}[0-9]{8}|(6|7){1}[0-9]{8})$/"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -z "$1" ]; then | |
echo ERROR. Use ./mataprocesos.sh process_name | |
exit | |
fi | |
kill $(ps -cef | grep $1 | awk '{print $2}') | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATABASES=(db1 db2 dbN) | |
DATE=$(date +"%Y-%m-%d") | |
USER='' | |
PASSWORD='' | |
DIR='/the/backup/route' | |
if [ ! -d "$DIR" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SITES=(site1 site2 site3) | |
DATE=$(date +"%Y-%m-%d") | |
DIR='/directory/where/sites/are' | |
BACKUPDIR='/directory/where/to_store/backup' | |
if [ ! -d "$BACKUPDIR" ]; then | |
mkdir $BACKUPDIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Simple HTML5 Video Player</title> | |
</head> | |
<body> | |
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> | |
<div> | |
Video URL: <input type="text" id="videoUrl" name="videoUrl"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php artisan tinker | |
$user = new App\User; | |
$user->name="Admin"; | |
$user->email="[email protected]"; | |
$user->password=bcrypt('1234'); | |
$user->save(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>CLICK TEST</title> | |
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drush dl drupal --drupal-project-rename="drupal" | |
cd drupal | |
drush site-install standard --account-name=admin --account-pass=admin --db-url=mysql://user:password@localhost/drupal -y | |
drush en features, views, date, calendar, token, pathauto, libraries, entity, admin_menu, jquery_update, webform, ckeditor, rules, colorbox, entity_reference, transliteration, field_group, captcha, recaptcha, devel, internationalization, strongarm, search_api, insert, views_data_export, print, simplenews, pathologic, webform_validation, bootstrap, tracker, syslog, statistics, date_popup, feeds_ui, feeds_import, feeds_news, rules_admin, search_api_views, views_ui -y | |
drush dl mailhandler -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang=""> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Create Folders / Read Folders</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://stackoverflow.com/questions/3211595/renaming-files-in-a-folder-to-sequential-numbers/34153342#34153342 | |
ls | cat -n | while read n f; do mv "$f" "$n.extension"; done |
OlderNewer