This is a collection of useful regex formulas that I have found on the internet, to be honest mainly on stackoverflow :) #Selection
\{[^}]*\}
(["'])(?:(?=(\\?))\2.)*?\1
| # Code example for: | |
| # Hello World - Machine Learning Recipes #1 - Google Developers | |
| # https://www.youtube.com/watch?v=cKxRvEZd3Mw | |
| from sklearn import tree | |
| # Bumpy = 0, Smooth = 1 | |
| features = [[140, 1], [130, 1], [150, 0], [170, 0]] | |
| # Apple = 0, Orange = 1 | |
| labels = [0, 0, 1, 1] |
| <?php | |
| function get_this_location_path() { | |
| $parts = parse_url($_SERVER['PHP_SELF']); | |
| if (!isset($parts['scheme'])) { | |
| $parts['scheme'] = "http"; | |
| if (isset($_SERVER["HTTPS"]) && | |
| $_SERVER["HTTPS"] == "on") | |
| { | |
| $parts['scheme'] .= "s"; |
| <?php | |
| /** | |
| * Returns the inverse of the standard normal cumulative distribution. | |
| * The distribution has a mean of zero and a standard deviation of one. | |
| * Resources: | |
| * http://board.phpbuilder.com/showthread.php?10367349-PHP-NORMSINV | |
| * http://www.source-code.biz/snippets/vbasic/9.htm | |
| * @param integer $week number of week | |
| * @return float sales | |
| */ |
| php artisan key:generate --show |
| /** | |
| * 1. Create the database | |
| * Change: | |
| * <database_name>: to your database name | |
| */ | |
| CREATE DATABASE <database_name>; | |
| /** | |
| * 2. Create the user | |
| * Change: |
| +----------------------------------------+----------------------+---------+----------------+ | |
| | Actions Handled By Resource Controller | | | | | |
| +----------------------------------------+----------------------+---------+----------------+ | |
| | Verb | URI | Action | Route Name | | |
| | GET | /photos | index | photos.index | | |
| | GET | /photos/create | create | photos.create | | |
| | POST | /photos | store | photos.store | | |
| | GET | /photos/{photo} | show | photos.show | | |
| | GET | /photos/{photo}/edit | edit | photos.edit | | |
| | PUT/PATCH | /photos/{photo} | update | photos.update | |
| # Shows the branches that should be deleted | |
| # Resource: https://kparal.wordpress.com/2011/04/15/git-tip-of-the-day-pruning-stale-remote-tracking-branches/ | |
| git remote prune origin --dry-run | |
| # Deletes the branches | |
| git remote prune origin | |
| # It can also be done with fetch | |
| git fetch origin --prune |
| # Taken from: | |
| # https://coderwall.com/p/x3jmig/remove-all-your-local-git-branches-but-keep-master | |
| $ git branch | grep -v "master" | xargs git branch -D |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="description" content="Description"> | |
| <title>File</title> | |
| <script> | |
| // Este método va a dar error por que jQuery no se ha cargado | |
| $('body').change(function() { }); | |
| </script> |