- https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes
- https://www.reddit.com/r/laravel/comments/3to60i/50_laravel_tricks/
- 1. Automatic Model Validation
| # import config. | |
| # You can change the default config with `make cnf="config_special.env" build` | |
| cnf ?= config.env | |
| include $(cnf) | |
| export $(shell sed 's/=.*//' $(cnf)) | |
| # import deploy config | |
| # You can change the default deploy config with `make cnf="deploy_special.env" release` | |
| dpl ?= deploy.env | |
| include $(dpl) |
| function doGet(request) { | |
| if (request.parameters.url != undefined && request.parameters.url != "") { | |
| var imageBlob = UrlFetchApp.fetch(request.parameters.url).getBlob(); | |
| var resource = { | |
| title: imageBlob.getName(), | |
| mimeType: imageBlob.getContentType() | |
| }; | |
| var options = { | |
| ocr: true | |
| }; |
| This post examines the features of [R Markdown](http://www.rstudio.org/docs/authoring/using_markdown) | |
| using [knitr](http://yihui.name/knitr/) in Rstudio 0.96. | |
| This combination of tools provides an exciting improvement in usability for | |
| [reproducible analysis](http://stats.stackexchange.com/a/15006/183). | |
| Specifically, this post | |
| (1) discusses getting started with R Markdown and `knitr` in Rstudio 0.96; | |
| (2) provides a basic example of producing console output and plots using R Markdown; | |
| (3) highlights several code chunk options such as caching and controlling how input and output is displayed; | |
| (4) demonstrates use of standard Markdown notation as well as the extended features of formulas and tables; and | |
| (5) discusses the implications of R Markdown. |
| -- This is v0.6 of the custom script for AlfredApp for iTerm 2.9+ | |
| -- Please see https://github.com/stuartcryan/custom-iterm-applescripts-for-alfred/ | |
| -- for the latest changes. | |
| -- Please note, if you store the iTerm binary in any other location than the Applications Folder | |
| -- please ensure you update the two locations below (in the format of : rather than / for folder dividers) | |
| -- this gets around issues with AppleScript not handling things well if you have two iTerm binaries on your system... which can happen :D | |
| on alfred_script(q) | |
| if application "iTerm2" is running or application "iTerm" is running then |
| /* | |
| This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a | |
| valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to | |
| that colour and the font colour will be changed to the inverse colour for readability. | |
| To use this script in a Google Sheets spreadsheet: | |
| 1. go to Tools » Script Editor » Spreadsheet; | |
| 2. erase everything in the text editor; | |
| 3. change the title to "Set colour preview on edit"; |
Getting started:
Related tutorials:
| [ | |
| {"iso" : "AF", "country" : "Afghanistan"}, | |
| {"iso" : "AL", "country" : "Albania"}, | |
| {"iso" : "DZ", "country" : "Algeria"}, | |
| {"iso" : "AS", "country" : "American Samoa"}, | |
| {"iso" : "AD", "country" : "Andorra"}, | |
| {"iso" : "AO", "country" : "Angola"}, | |
| {"iso" : "AI", "country" : "Anguilla"}, | |
| {"iso" : "AQ", "country" : "Antarctica"}, | |
| {"iso" : "AG", "country" : "Antigua and Barbuda"}, |
| define("XHPROF_ROOT", '/var/www/xhprof-0.9.4'); | |
| App::before(function(){ | |
| xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY); | |
| }); | |
| App::after(function(){ | |
| require_once (XHPROF_ROOT . '/xhprof_lib/utils/xhprof_lib.php'); | |
| require_once (XHPROF_ROOT . '/xhprof_lib/utils/xhprof_runs.php'); |
| # Requires ImageMagick | |
| # Converting the source from JPEG to PNG - if necessary | |
| convert my_src_image.jpg my_src_image.png | |
| # Option A | |
| # - Requires a temporary intermediate file | |
| # - Drill more than 10 might result in poor results |