https://github.com/mailru/FileAPI
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 | |
| $finder = Symfony\Component\Finder\Finder::create() | |
| ->exclude('vendor') | |
| ->exclude('bootstrap') | |
| ->exclude('storage') | |
| ->in(__DIR__) | |
| ->name('*.php') | |
| ->notName('*.blade.php'); |
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
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| case $- in | |
| *i*) ;; | |
| *) return;; | |
| esac |
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; | |
| use Illuminate\Database\Eloquent\Model; | |
| class Flight extends Model | |
| { | |
| /** | |
| * The table associated with the model. |
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 --version | |
| PHP 7.0.28-0ubuntu0.16.04.1 (cli) ( NTS ) | |
| Copyright (c) 1997-2017 The PHP Group | |
| Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies | |
| with Zend OPcache v7.0.28-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies | |
| $ php -m | |
| [PHP Modules] |
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
| # /home partition | |
| # https://help.ubuntu.com/community/Partitioning/Home/Moving | |
| # Basics | |
| sudo apt update | |
| sudo apt install curl vim git libpng-dev | |
| sudo apt remove apache2 | |
| # Remove snapd | |
| # https://askubuntu.com/questions/1035915/how-to-remove-snap-store-from-ubuntu |
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
| Sublime Text Configuration Notes | |
| 1. Install Package Control | |
| ctrl + ` | |
| import urllib.request,os,hashlib; h = 'df21e130d211cfc94d9b0905775a7c0f' + '1e3d39e33b79698005270310898eea76'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by) | |
| 2. Install SidebarEnhancements |
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
Show hidden characters
| { | |
| "added_words": | |
| [ | |
| "Laravel" | |
| ], | |
| "binary_file_patterns": | |
| [ | |
| "*.dds", | |
| "*.eot", | |
| "*.gif", |
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
| <input v-el="avatar" type="file" name="avatar" id="avatar" v-on="change:upload"> | |
| methods: { | |
| upload: function(e) { | |
| e.preventDefault(); | |
| var files = this.$$.avatar.files; | |
| var data = new FormData(); | |
| // for single file | |
| data.append('avatar', files[0]); | |
| // Or for multiple files you can also do | |
| // _.each(files, function(v, k){ |
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
| private function parseSenderEmail($body) | |
| { | |
| $start = strpos($body, '<'); | |
| // Make sure we have a valid starting point | |
| if ($start === false) { | |
| // This is not a properly formatted message | |
| return ''; | |
| } |