This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # How to use "acme.sh" to set up Lets Encrypt without root permissions | |
| # See https://github.com/Neilpang/acme.sh for more | |
| # This assumes that your website has a webroot at "/var/www/<domain>" | |
| # I'll use the domain "EXAMPLE.com" as an example | |
| # When this is done, there will be an "acme" user that handles issuing, | |
| # updating, and installing certificates. This account will have the following | |
| # (fairly minimal) permissions: | |
| # - Host files at http://EXAMPLE.com/.well-known/acme-challenge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $data = [ | |
| ['THE', 'A'], | |
| ['ELEPHANT', 'APPLE', 'CAR'], | |
| ['WALKED', 'DROVE', 'SAT'], | |
| ]; | |
| function solve(array $data){ | |
| $current = array_shift($data); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function add_embed_tweet_meta_box() { | |
| add_meta_box( | |
| 'paulund_embed_tweet_meta_box', // $id | |
| 'Post Embed Tweets Meta Box', // $title | |
| 'show_embed_tweet_meta_box', // $callback | |
| 'post', // $page | |
| 'normal', // $context | |
| 'high'); // $priority | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Call protected or private method of a class. | |
| * | |
| * @param object $object instantiated object that we will run method on. | |
| * @param string $method_name method name to call | |
| * @param array $parameters array of parameters to pass into method. | |
| * | |
| * @return mixed Method return. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Requests; | |
| use Illuminate\Foundation\Http\FormRequest; | |
| class Request extends FormRequest | |
| { | |
| public function authorize() | |
| { | |
| return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| define('START', microtime(true)); | |
| define('START_MEMORY', memory_get_peak_usage(true)); | |
| collect(range(0, 1000000))->slice(500000)->forPage(3,20); | |
| define('END', microtime(true)); | |
| define('END_MEMORY', memory_get_peak_usage(true)); | |
| echo END - START,',',END_MEMORY - START_MEMORY; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen ${3:-80}; | |
| listen ${4:-443} ssl http2; | |
| server_name .$1; | |
| root $2; | |
| index index.html index.htm index.php; | |
| charset utf-8; |