Tutorial by Examples

php artisan route:list --method=GET --method=POST This will include all routes that accept GET and POST methods simultaneously.
Salt can be installed via : salt-bootstrap: a shell script, that can install salt (client and/or master packages) on standard Unix/Linux platform, Platform Specific binaries: available for Windows, Mac OS X and Linux, Package Management systems: available for pacman, apt-get, yum and other pack...
TreeWalker is a generator-like interface that makes recursively filtering nodes in a DOM tree easy and efficient. The following code concatenates the value of all Text nodes in the page, and prints the result. let parentNode = document.body; let treeWalker = document.createTreeWalker(parentNode, ...
Stored procedures can be created through a database management GUI (SQL Server example), or through a SQL statement as follows: -- Define a name and parameters CREATE PROCEDURE Northwind.getEmployee @LastName nvarchar(50), @FirstName nvarchar(50) AS -- Define the query to be...
Simple form with labels... <form action="/login" method="POST"> <label for="username">Username:</label> <input id="username" type="text" name="username" /> <label for="pass">Pa...
Remarks Every motion can be used after an operator command, so the command operates on the text comprised by the movement's reach. Just like operator commands, motions can include a count, so you can move by 2words, for example. Arrows In Vim, normal arrow/cursor keys (←↓↑→) work as expected...
Horizontally vim -o file1.txt file2.txt Vertically vim -O file1.txt file2.txt You may optionally specify the number of splits to open. The following example opens two horizontal splits and loads file3.txt in a buffer: vim -o2 file1.txt file2.txt file3.txt
You are allowed to implement custom exceptions that can be thrown just like any other exception. This makes sense when you want to make your exceptions distinguishable from other errors during runtime. In this example we will create a custom exception for clear handling of problems the application ...
<!DOCTYPE html> <html> <head> <meta charset='utf-8' /> <title></title> <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> <!-- find the latest library and style versions here: https://www.mapbox.com/m...
In normal mode: ~ inverts the case of the character under the cursor, gu{motion} lowercases the text covered by {motion}, gU{motion} uppercases the text covered by {motion} Example (^ marks the cursor position): Lorem ipsum dolor sit amet. ^ Lorem ipSum dolor sit amet. ~ Lorem...
So, you make first a .war file let's say a portlet of name <YOUR PLUGIN>.war. You wanna have it running on a glassfish domain under Liferay portal. Steps to success: Navigate to Control Panel -> Plugins Installation on Liferay Hit Install new portlets Hit Configuration Fill in to Dep...
The UPPER function allows you to convert all lowercase letters in a string to uppercase. SELECT UPPER('My text 123!') AS result FROM dual; Output: RESULT ------------ MY TEXT 123!
A while loop will cause the loop statements to be executed until the loop condition is falsey. The following code will execute the loop statements a total of 4 times. i = 0 while i < 4: #loop statements i = i + 1 While the above loop can easily be translated into a more elegant fo...
Before to launch you to code with Pug, you need to have some prerequisits. You will need to install: NodeJS with NPM ExpressJS (optional) After installing NodeJS, you can check in your terminal the correct installation doing: $ node -v If successful, it will print the number of Node's ve...
Summary This goal is to reorganize all of your scattered commits into more meaningful commits for easier code reviews. If there are too many layers of changes across too many files at once, it is harder to do a code review. If you can reorganize your chronologically created commits into topical com...
The History Microsoft windows is an operating system available in 137 languages, wrote in C,C++ & Assembly , can be installed on "ARM, IA-32, Itanium, x86-64, DEC Alpha, MIPS, PowerPC" platforms first release was in November 20 ,1985 as windows 1.0 with about 2 billion PC(per...
git log --after '3 days ago' Specific dates work too: git log --after 2016-05-01 As with other commands and flags that accept a date parameter, the allowed date format is as supported by GNU date (highly flexible). An alias to --after is --since. Flags exist for the converse too: --before ...
Itertools "islice" allows you to slice a generator: results = fetch_paged_results() # returns a generator limit = 20 # Only want the first 20 results for data in itertools.islice(results, limit): print(data) Normally you cannot slice a generator: def gen(): n = 0 wh...
If your code encounters a condition it doesn't know how to handle, such as an incorrect parameter, it should raise the appropriate exception. def even_the_odds(odds): if odds % 2 != 1: raise ValueError("Did not get an odd number") return odds + 1
Use try...except: to catch exceptions. You should specify as precise an exception as you can: try: x = 5 / 0 except ZeroDivisionError as e: # `e` is the exception object print("Got a divide by zero! The exception was:", e) # handle exceptional case x = 0 final...

Page 208 of 1336