#Use pprof debug docker daemon
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 // /app/Http/Middleware/Cors.php | |
| namespace App\Http\Middleware; | |
| use Closure; | |
| class Cors { | |
| public function handle($request, Closure $next) | |
| { | |
| return $next($request) |
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
| 'use strict'; | |
| // The purpose of this example is to show | |
| // how you can block the event loop with JavaScript. | |
| // There is 3 routes | |
| // / respond with Hello, World text | |
| // /block uses JavaScript while for 5 seconds | |
| // /non-block uses setTimeout for 5 seconds | |
| // Do the following |
This is a git pre-push hook intended to help developers keep their PHP code base clean by performing a scan with PHP CodeSniffer whenever new code is pushed to the repository. When any coding standards violations are present the push is rejected, allowing the developer to fix the code before making it public.
To increase performance only the changed files are checked when new code is
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
| // https://codepen.io/hartzis/pen/VvNGZP | |
| class ImageUpload extends Component { | |
| constructor(props) { | |
| super(props); | |
| this.state = { | |
| file: '', | |
| imagePreviewUrl: '' | |
| }; | |
| this._handleImageChange = this._handleImageChange.bind(this); | |
| this._handleSubmit = this._handleSubmit.bind(this); |
Go to the egghead website, i.e. Building a React.js App
run
$.each($('h4 a'), function(index, video){
console.log(video.href);
});
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
| #with docker | |
| docker run -it -v "$PWD"/mongo_dump:/data/dump --rm mongo:3.0.5 sh -c 'exec mongodump --out /data/dump --host=1.2.3.4 --db the_database' | |
| docker run -it -v "$PWD"/mongo_dump:/data/dump --rm mongo:3.0.5 sh -c 'exec mongorestore --host=1.2.3.4 --db the_database /data/dump/the_database --drop' | |
| #dump | |
| sudo mongodump | |
| #restore (droping previous data) | |
| sudo mongorestore |
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
| config: | |
| from_address: [email protected] | |
| carriers: | |
| alltel: | |
| name: Alltel | |
| value: @message.alltel.com | |
| ameritech: | |
| name: Ameritech | |
| value: @paging.acswireless.com |