diff --git a/README.md b/README.md index 1264254..896e4cb 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,10 @@ Feel free to take a look. You might learn new things. They have been designed to
View cheatsheets +#### PHP + +- [Laravel](backend/laravel.php) + #### Python - [Django](backend/django.py) @@ -101,27 +105,3 @@ Feel free to take a look. You might learn new things. They have been designed to ## 🙌🏼 How to Contribute? You are more than welcome to contribute and build your own cheatsheet for your favorite programming language, framework or development tool. Just submit changes via pull request and I will review them before merging. - -## 🙏🏻 Contribution - - - - - - - - - -
- - - - - - - - - -
- -> 👋 Do you want your company to be listed there? Contribute with a cheatsheet for your favorite programming language, framework or development tool. diff --git a/backend/django.py b/backend/django.py index 42895ed..3cc384c 100644 --- a/backend/django.py +++ b/backend/django.py @@ -48,3 +48,5 @@ django-admin startapp # create a new django application with django-admin migrate # synchronize the database state with your current state project models and migrations django-admin makemigrations # create new migrations to the database based on the changes detected in the models django-admin runserver # start the development webserver at 127.0.0.1 with the port 8000 +django-admin help # display usage information and a list of the commands provided by each application +django-admin version # display the current django version diff --git a/backend/laravel.php b/backend/laravel.php new file mode 100644 index 0000000..70d128a --- /dev/null +++ b/backend/laravel.php @@ -0,0 +1,381 @@ +assertStatus($code); // Assert that the response has a given code. +$response->assertForbidden(); // Assert that the response has a forbidden status code. +$response->assertNotFound(); // Assert that the response has a not found status code. +$response->assertOk(); // Assert that the response has a 200 status code. +$response->assertSuccessful(); // Assert that the response has a successful status code. +$response->assertRedirect($uri); // Assert that the response is a redirect to a given URI. + +$response->assertHeader($headerName, $value = null); // Assert that the given header is present on the response. +$response->assertHeaderMissing($headerName); // Assert that the given header is not present on the response. + +$response->assertExactJson(array $data); // Assert that the response contains an exact match of the given JSON data. +$response->assertJson(array $data); // Assert that the response contains the given JSON data. +$response->assertJsonCount($count, $key = null); // Assert that the response JSON has an array with the expected number of items at the given key. +$response->assertJsonFragment(array $data); // Assert that the response contains the given JSON fragment. +$response->assertJsonMissing(array $data); // Assert that the response does not contain the given JSON fragment. +$response->assertJsonMissingExact(array $data); // Assert that the response does not contain the exact JSON fragment. +$response->assertJsonMissingValidationErrors($keys); // Assert that the response has no JSON validation errors for the given keys. +$response->assertJsonStructure(array $structure); // Assert that the response has a given JSON structure. +$response->assertJsonValidationErrors($keys); // Assert that the response has the given JSON validation errors for the given keys. + +$response->assertDontSee($value); // Assert that the given string is not contained within the response. +$response->assertDontSeeText($value); // Assert that the given string is not contained within the response text. +$response->assertSee($value); // Assert that the given string is contained within the response. +$response->assertSeeInOrder(array $values); // Assert that the given strings are contained in order within the response. +$response->assertSeeText($value); // Assert that the given string is contained within the response text. +$response->assertSeeTextInOrder(array $values); // Assert that the given strings are contained in order within the response text. + +$response->assertCookie($cookieName, $value = null); // Assert that the response contains the given cookie. +$response->assertCookieExpired($cookieName); // Assert that the response contains the given cookie and it is expired. +$response->assertCookieNotExpired($cookieName); // Assert that the response contains the given cookie and it is not expired. +$response->assertCookieMissing($cookieName); // Assert that the response does not contains the given cookie. +$response->assertPlainCookie($cookieName, $value = null); // Assert that the response contains the given cookie (unencrypted). + +$response->assertSessionHas($key, $value = null); // Assert that the session contains the given piece of data. +$response->assertSessionHasAll(array $data); // Assert that the session has a given list of values. +$response->assertSessionHasErrors(array $keys, $format = null, $errorBag = 'default'); // Assert that the session contains an error for the given field. +$response->assertSessionHasErrorsIn($errorBag, $keys = [], $format = null); // Assert that the session has the given errors. +$response->assertSessionHasNoErrors(); // Assert that the session has no errors. +$response->assertSessionDoesntHaveErrors($keys = [], $format = null, $errorBag = 'default'); // Assert that the session has no errors for the given keys. +$response->assertSessionMissing($key); // Assert that the session does not contain the given key. + +$response->assertViewHas($key, $value = null); // Assert that the response view was given a piece of data. +$response->assertViewHasAll(array $data); // Assert that the response view has a given list of data. +$response->assertViewIs($value); // Assert that the given view was returned by the route. +$response->assertViewMissing($key); // Assert that the response view is missing a piece of bound data. + +$this->assertAuthenticated($guard = null); // Assert that the user is authenticated. +$this->assertGuest($guard = null); // Assert that the user is not authenticated. +$this->assertAuthenticatedAs($user, $guard = null); // Assert that the given user is authenticated. +$this->assertCredentials(array $credentials, $guard = null); // $this->assertCredentials(array $credentials, $guard = null). +$this->assertInvalidCredentials(array $credentials, $guard = null); // Assert that the given credentials are invalid. diff --git a/frontend/html5.html b/frontend/html5.html index e1691ba..e40173c 100644 --- a/frontend/html5.html +++ b/frontend/html5.html @@ -6,8 +6,8 @@ - - + + diff --git a/languages/bash.sh b/languages/bash.sh index ea2606e..866968b 100644 --- a/languages/bash.sh +++ b/languages/bash.sh @@ -219,12 +219,12 @@ statement1 || statement2 # or operator # STRINGS -str1 = str2 # str1 matches str2 -str1 != str2 # str1 does not match str2 -str1 < str2 # str1 is less than str2 (alphabetically) -str1 > str2 # str1 is greater than str2 (alphabetically) --n str1 # str1 is not null (has length greater than 0) --z str1 # str1 is null (has length 0) +str1 == str2 # str1 matches str2 +str1 != str2 # str1 does not match str2 +str1 < str2 # str1 is less than str2 (alphabetically) +str1 > str2 # str1 is greater than str2 (alphabetically) +-n str1 # str1 is not null (has length greater than 0) +-z str1 # str1 is null (has length 0) # FILES @@ -411,7 +411,7 @@ function errtrap { echo "ERROR line $1: Command exited with status $es." } -trap 'errtrap $LINENO' ERR # is run whenever a command in the surrounding script or function exits with non-zero status +trap 'errtrap $LINENO' ERR # is run whenever a command in the surrounding script or function exits with non-zero status function dbgtrap { echo "badvar is $badvar" diff --git a/tools/docker.sh b/tools/docker.sh index 3149392..a24f374 100644 --- a/tools/docker.sh +++ b/tools/docker.sh @@ -22,6 +22,8 @@ docker push username/repository:tag # Upload tagged image to registry docker run username/repository:tag # Run image from a registry docker system prune # Remove all unused containers, networks, images (both dangling and unreferenced), and optionally, volumes. (Docker 17.06.1-ce and superior) docker system prune -a # Remove all unused containers, networks, images not just dangling ones (Docker 17.06.1-ce and superior) +docker volume prune # Remove all unused local volumes +docker network prune # Remove all unused networks ############################################################################## diff --git a/tools/nanobox_cli.sh b/tools/nanobox_cli.sh index 522fba2..dcabda4 100644 --- a/tools/nanobox_cli.sh +++ b/tools/nanobox_cli.sh @@ -99,7 +99,7 @@ nanobox version # Add a convenient way to access your app from the browser nanobox dns add local vue.dev -nanobox dns add local django.dev +nanobox dns add local laravel.dev # Run your app as you would normally, with Nanobox nanobox run npm run dev --host 0.0.0.0 @@ -116,7 +116,7 @@ nanobox info local # Add a DNS Alias to a dry-run app -nanobox dns add dry-run django.preview +nanobox dns add dry-run laravel.preview # Preview your app locally nanobox deploy dry-run diff --git a/tools/vscode.md b/tools/vscode.md index 77b4b71..5f51625 100644 --- a/tools/vscode.md +++ b/tools/vscode.md @@ -26,6 +26,18 @@ - `Vetur`: Vue tooling for VS Code. +### PHP + +- `Better PHPUnit`: A better PHPUnit test runner. + +- `Laravel Artisan`: Laravel Artisan commands within Visual Studio Code. + +- `PHP CS Fixer`: PHP CS Fixer extension for VS Code, php formatter, php code beautify tool. + +- `PHP Doc Comment VSCode Plugin`: Add phpdoc @param and @return tag for selected function signatures. + +- `PHP IntelliSense`: Advanced Autocompletion and Refactoring support for PHP. + ### Git - `Git History`: View git log, file history, compare branches or commits. @@ -44,6 +56,8 @@ - `EditorConfig for VS Code`: EditorConfig Support for Visual Studio Code. +- `File Utils`: A convenient way of creating, duplicating, moving, renaming and deleting files and directories. + - `Final-Newline`: Inserts a final newline when saving the document. - `Formatting Toggle`: A VS Code extension that allows you to toggle the formatter (Prettier, Beautify, …) ON and OFF with a simple click. @@ -56,21 +70,21 @@ - `Prettier - Code formatter`: VS Code plugin for prettier/prettier. +- `Project Manager`: Easily switch between projects. + - `REST Client`: REST Client for Visual Studio Code. - `SVG Viewer`: SVG Viewer for Visual Studio Code. - `Terminal`: Terminal for Visual Studio Code. +- `Vue Peek`: Allows peek and goto definition for Vue single-file components. + - `VS Live Share`: Real-time collaborative development from the comfort of your favorite tools. - `Wrap Console Log`: Wrap to console.log by word or selection. -############################################################################## - -# USER SETTINGS - -############################################################################## +## My Settings ```javascript {