- 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
| #!/bin/bash -e | |
| ## | |
| # WordPress Installation and VirtualHost Creation | |
| # | |
| # Description: Installs a WordPress website in the ~/Sites folder, creates a homepage, | |
| # cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks, | |
| # clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes, | |
| # installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file | |
| # to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress |
| <?php | |
| $finder = Symfony\Component\Finder\Finder::create() | |
| ->notPath('bootstrap/cache') | |
| ->notPath('storage') | |
| ->notPath('vendor') | |
| ->in(__DIR__) | |
| ->name('*.php') | |
| ->notName('*.blade.php') | |
| ->ignoreDotFiles(true) |
| import facebook | |
| from collections import Counter | |
| import requests | |
| likes_counter = Counter() | |
| # Get temp tokens at: https://developers.facebook.com/tools/explorer/ | |
| USER_ACCESS_TOKEN = "" | |
| client = facebook.GraphAPI(access_token=USER_ACCESS_TOKEN, version='2.5') |
This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.
This documentation has moved here: https://github.com/johnbillion/wp_mail
A running example of the code from:
This gist creates a working example from blog post, and a alternate example using simple worker pool.
TLDR: if you want simple and controlled concurrency use a worker pool.
| #Insall Ajenti | |
| apt-get update | |
| wget http://repo.ajenti.org/debian/key -O- | apt-key add - | |
| echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list | |
| apt-get update | |
| apt-get install ajenti | |
| service ajenti restart | |
| # Uninstall Apache2 | |
| sudo apt-get autoremove && sudo apt-get remove apache2* |
| #!/usr/bin/env php | |
| <?php | |
| //usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page | |
| set_time_limit(0); | |
| $dir = $argv[1]; | |
| $source = $argv[2]; | |
| print_r($argv); | |
| mkdir ($dir); | |
| $src = file_get_contents($source); | |
| $pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i'; |
The process starts by creating the CSR and the private key:
openssl req -nodes -newkey rsa:2048 -nodes -keyout dotmarks.net.key -out dotmarks.net.csr -subj "/C=GB/ST=London/L=London/O=dotmarks/OU=IT/CN=dotmarks.net"
Generates