Merge pull request #1 from LeCoupa/master

feat: Newer updates
This commit is contained in:
Deepak Guptha
2019-08-09 16:58:34 +02:00
committed by GitHub
8 changed files with 419 additions and 40 deletions

View File

@@ -40,6 +40,10 @@ Feel free to take a look. You might learn new things. They have been designed to
<details> <details>
<summary>View cheatsheets</summary> <summary>View cheatsheets</summary>
#### PHP
- [Laravel](backend/laravel.php)
#### Python #### Python
- [Django](backend/django.py) - [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? ## 🙌🏼 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. 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
<table>
<tr>
<td align="center">
<a href="https://crisp.chat/?ta=oR1nEv43TM" target="_blank"><img src="https://pbs.twimg.com/profile_images/651629444944273408/r5Kd_ifq_400x400.png" height="64" /></a>
</td>
<td align="center">
<a href="http://try.anyleads.com/secret" target="_blank"><img src="https://pbs.twimg.com/profile_images/838140522476761094/A4WpBe5M_400x400.jpg" height="64" /></a>
</td>
<td align="center">
<a href="https://hackr.io/" target="_blank"><img src="https://d1eq8vvyuam4eq.cloudfront.net/assets/images/code-images/code-apple-touch-icon-precomposed.png" height="64" /></a>
</td>
<td align="center">
<a href="https://learnk8s.io/" target="_blank"><img src="https://pbs.twimg.com/profile_images/925127335573114880/9yCkEIe3_400x400.jpg" height="64" /></a>
</td>
<td align="center">
<a href="https://www.voxygen.com/" target="_blank"><img src="https://imgur.com/XQoVtag.png" height="64" /></a>
</td>
</tr>
</table>
> 👋 Do you want your company to be listed there? Contribute with a cheatsheet for your favorite programming language, framework or development tool.

View File

@@ -48,3 +48,5 @@ django-admin startapp <Appname> # create a new django application with
django-admin migrate # synchronize the database state with your current state project models and migrations 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 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 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

381
backend/laravel.php Normal file
View File

@@ -0,0 +1,381 @@
<?php
/********************************************************************************************
* 1. CLI AVAILABLE COMMANDS FOR ARTISAN
* https://laravel.com/docs/5.8/artisan
********************************************************************************************/
// 1.1. MAIN.
php artisan clear-compiled // Remove the compiled class file
php artisan down // Put the application into maintenance mode
php artisan dump-server // Start the dump server to collect dump information.
php artisan env // Display the current framework environment
php artisan help // Displays help for a command
php artisan inspire // Display an inspiring quote
php artisan list // Lists commands
php artisan migrate // Run the database migrations
php artisan optimize // Cache the framework bootstrap files
php artisan preset // Swap the front-end scaffolding for the application
php artisan serve // Serve the application on the PHP development server
php artisan tinker // Interact with your application
php artisan up // Bring the application out of maintenance mode
// 1.2. APP.
php artisan app:name // Set the application namespace
// 1.3. AUTH
php artisan auth:clear-resets // Flush expired password reset tokens
// 1.4. CACHE
php artisan cache:clear // Flush the application cache
php artisan cache:forget // Remove an item from the cache
php artisan cache:table // Create a migration for the cache database table
// 1.5. CONFIG
php artisan config:cache // Create a cache file for faster configuration loading
php artisan config:clear // Remove the configuration cache file
// 1.6. DB
php artisan db:seed // Seed the database with records
// 1.7. EVENT
php artisan event:generate // Generate the missing events and listeners based on registration
// 1.8. KEY
php artisan key:generate // Set the application key
// 1.9. MAKE
php artisan make:auth // Scaffold basic login and registration views and routes
php artisan make:channel // Create a new channel class
php artisan make:command // Create a new Artisan command
php artisan make:controller // Create a new controller class
php artisan make:event // Create a new event class
php artisan make:exception // Create a new custom exception class
php artisan make:factory // Create a new model factory
php artisan make:job // Create a new job class
php artisan make:listener // Create a new event listener class
php artisan make:mail // Create a new email class
php artisan make:middleware // Create a new middleware class
php artisan make:migration // Create a new migration file
php artisan make:model // Create a new Eloquent model class
php artisan make:notification // Create a new notification class
php artisan make:observer // Create a new observer class
php artisan make:policy // Create a new policy class
php artisan make:provider // Create a new service provider class
php artisan make:request // Create a new form request class
php artisan make:resource // Create a new resource
php artisan make:rule // Create a new validation rule
php artisan make:seeder // Create a new seeder class
php artisan make:test // Create a new test class
// 1.10. MIGRATE
php artisan migrate:fresh // Drop all tables and re-run all migrations
php artisan migrate:install // Create the migration repository
php artisan migrate:refresh // Reset and re-run all migrations
php artisan migrate:reset // Rollback all database migrations
php artisan migrate:rollback // Rollback the last database migration
php artisan migrate:status // Show the status of each migration
// 1.11. NOTIFICATIONS
php artisan notifications:table // Create a migration for the notifications table
// 1.12. OPTIMIZE
php artisan optimize:clear // Remove the cached bootstrap files
// 1.13. PACKAGE
php artisan package:discover // Rebuild the cached package manifest
// 1.14. QUEUE
php artisan queue:failed // List all of the failed queue jobs
php artisan queue:failed-table // Create a migration for the failed queue jobs database table
php artisan queue:flush // Flush all of the failed queue jobs
php artisan queue:forget // Delete a failed queue job
php artisan queue:listen // Listen to a given queue
php artisan queue:restart // Restart queue worker daemons after their current job
php artisan queue:retry // Retry a failed queue job
php artisan queue:table // Create a migration for the queue jobs database table
php artisan queue:work // Start processing jobs on the queue as a daemon
// 1.15. ROUTE
php artisan route:cache // Create a route cache file for faster route registration
php artisan route:clear // Remove the route cache file
php artisan route:list // List all registered routes
// 1.16. SCHEDULE
php artisan schedule:run // Run the scheduled commands
// 1.17. SESSION
php artisan session:table // Create a migration for the session database table
// 1.18. STORAGE
php artisan storage:link // Create a symbolic link from "public/storage" to "storage/app/public"
// 1.19. VENDOR
php artisan vendor:publish // Publish any publishable assets from vendor packages
// 1.20. VIEW
php artisan view:cache // Compile all of the application's Blade templates
php artisan view:clear // Clear all compiled view files
/********************************************************************************************
* 2. REQUEST
* https://laravel.com/api/5.8/Illuminate/Http/Request.html
* https://laravel.com/docs/5.8/requests
********************************************************************************************/
/********************************************************************************************
* 3. RESPONSE
* https://laravel.com/api/5.8/Illuminate/Http/Response.html
* https://laravel.com/docs/5.8/responses
********************************************************************************************/
/********************************************************************************************
* 4. ROUTING
* https://laravel.com/docs/5.8/routing
********************************************************************************************/
/********************************************************************************************
* 5. MIDDLEWARE
* https://laravel.com/docs/5.8/middleware
********************************************************************************************/
/********************************************************************************************
* 6. CONTROLLERS
* https://laravel.com/docs/5.8/controllers
********************************************************************************************/
/********************************************************************************************
* 7. SESSION
* https://laravel.com/docs/5.8/session
********************************************************************************************/
/********************************************************************************************
* 8. URL GENERATION
* https://laravel.com/docs/5.8/urls
********************************************************************************************/
/********************************************************************************************
* 9. VALIDATION
* https://laravel.com/docs/5.8/validation
********************************************************************************************/
/********************************************************************************************
* 10. ERROR HANDLING
* https://laravel.com/docs/5.8/errors
********************************************************************************************/
/********************************************************************************************
* 11. LOGGING
* https://laravel.com/docs/5.8/logging
********************************************************************************************/
/********************************************************************************************
* 12. COLLECTIONS
* https://laravel.com/docs/5.7/collections
********************************************************************************************/
all
average
avg
chunk
collapse
combine
concat
contains
containsStrict
count
crossJoin
dd
diff
diffAssoc
diffKeys
dump
each
eachSpread
every
except
filter
first
firstWhere
flatMap
flatten
flip
forget
forPage
get
groupBy
has
implode
intersect
intersectByKeys
isEmpty
isNotEmpty
keyBy
keys
last
macro
make
map
mapInto
mapSpread
mapToGroups
mapWithKeys
max
median
merge
min
mode
nth
only
pad
partition
pipe
pluck
pop
prepend
pull
push
put
random
reduce
reject
reverse
search
shift
shuffle
slice
some
sort
sortBy
sortByDesc
sortKeys
sortKeysDesc
splice
split
sum
take
tap
times
toArray
toJson
transform
union
unique
uniqueStrict
unless
unlessEmpty
unlessNotEmpty
unwrap
values
when
whenEmpty
whenNotEmpty
where
whereStrict
whereBetween
whereIn
whereInStrict
whereInstanceOf
whereNotBetween
whereNotIn
whereNotInStrict
wrap
zip
/********************************************************************************************
* 13. HTTP TESTS
* https://laravel.com/docs/5.7/http-tests
********************************************************************************************/
$response->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.

View File

@@ -6,8 +6,8 @@
<!-- Document Summary --> <!-- Document Summary -->
<!DOCTYPE html> <!-- Tells the browser that HTML5 version of HTML to be recognized by the browser -->
<html></html> <!-- Indicates that the page is written in html --> <html lang="en"></html> <!-- The HTML lang attribute is used to identify the language of text content on the web. This information helps search engines return language specific results, -->
<head></head> <!-- Contains Information specific to the page like title, styles and scripts --> <head></head> <!-- Contains Information specific to the page like title, styles and scripts -->
<title></title> <!-- Title for the page that shows up in the browser title bar --> <title></title> <!-- Title for the page that shows up in the browser title bar -->
<body></body> <!-- Content that the user will see --> <body></body> <!-- Content that the user will see -->

View File

@@ -219,7 +219,7 @@ statement1 || statement2 # or operator
# STRINGS # STRINGS
str1 = str2 # str1 matches str2 str1 == str2 # str1 matches str2
str1 != str2 # str1 does not match str2 str1 != str2 # str1 does not match str2
str1 < str2 # str1 is less than str2 (alphabetically) str1 < str2 # str1 is less than str2 (alphabetically)
str1 > str2 # str1 is greater than str2 (alphabetically) str1 > str2 # str1 is greater than str2 (alphabetically)

View File

@@ -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 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 # 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 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
############################################################################## ##############################################################################

View File

@@ -99,7 +99,7 @@ nanobox version
# Add a convenient way to access your app from the browser # Add a convenient way to access your app from the browser
nanobox dns add local vue.dev 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 # Run your app as you would normally, with Nanobox
nanobox run npm run dev --host 0.0.0.0 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 # 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 # Preview your app locally
nanobox deploy dry-run nanobox deploy dry-run

View File

@@ -26,6 +26,18 @@
- `Vetur`: Vue tooling for VS Code. - `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
- `Git History`: View git log, file history, compare branches or commits. - `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. - `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. - `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. - `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. - `Prettier - Code formatter`: VS Code plugin for prettier/prettier.
- `Project Manager`: Easily switch between projects.
- `REST Client`: REST Client for Visual Studio Code. - `REST Client`: REST Client for Visual Studio Code.
- `SVG Viewer`: SVG Viewer for Visual Studio Code. - `SVG Viewer`: SVG Viewer for Visual Studio Code.
- `Terminal`: Terminal 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. - `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. - `Wrap Console Log`: Wrap to console.log by word or selection.
############################################################################## ## My Settings
# USER SETTINGS
##############################################################################
```javascript ```javascript
{ {