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
| let _ = require('lodash') | |
| let thing = [ | |
| {"a": 123}, | |
| {"a": 456}, | |
| {"abc": 6789}, | |
| ] | |
| console.log(typeof(thing)) | |
| let result = _.pickBy(thing, function(value, key){ |
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
| let _ = require('lodash') | |
| var data = [{ | |
| "name": "jim", | |
| "color": "blue", | |
| "age": "22" | |
| }, { | |
| "name": "Sam", | |
| "color": "blue", | |
| "age": "33" |
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
| let TickTock = createReactClass({ | |
| componentDidMount: function() | |
| { | |
| // fetch data action here | |
| }, | |
| render: function() | |
| { | |
| return ( | |
| <div> | |
| render the class |
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 | |
| include_once(realpath(__DIR__ . '/vendor/autoload.php')); | |
| Predis\Autoloader::register(); | |
| $client = new Predis\Client([ | |
| 'scheme' => 'tcp', | |
| 'host' => '127.0.0.1', | |
| 'port' => 6379, |
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
| { | |
| "require": { | |
| "slim/slim": "^3.7", | |
| "slim/php-view": "^2.2", | |
| "bryanjhv/slim-session": "^3.0", | |
| "illuminate/database": "^5.4", | |
| "vlucas/phpdotenv": "^2.4", | |
| "monolog/monolog": "^1.22", | |
| "deployer/deployer": "^4.2", | |
| "tuupola/slim-jwt-auth": "^2.3" |
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
| <phpunit | |
| backupGlobals="false" | |
| colors="true" | |
| bootstrap="vendor/autoload.php" | |
| > | |
| <testsuites> | |
| <testsuite name="Test Suite"> | |
| <directory>tests</directory> | |
| </testsuite> | |
| </testsuites> |
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
| var webpack = require('webpack'); | |
| var path = require('path'); | |
| module.exports = { | |
| context: __dirname, | |
| devtool: "inline-sourcemap" , | |
| entry: [ | |
| "./src/app.js", | |
| "webpack-dev-server/client?http://localhost:8080", | |
| "webpack/hot/dev-server" |
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 80; | |
| server_name localhost; | |
| root [directory_path]/public; | |
| index index.php | |
| location / { | |
| try_files $uri $uri/ /index.html; | |
| if (!-e $request_filename){ rewrite ^(.*)$ /index.php last; } |
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 inverse($x) { | |
| if(!$x) | |
| throw new Exception("Division by zero."); | |
| return 1 / $x; | |
| } | |
| try { | |
| echo inverse(5)."\n"; | |
| echo inverse(0)."\n"; |
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
| var path = require('path'); | |
| module.exports = { | |
| entry: [ | |
| './src/app.js', | |
| ], | |
| devtool: 'source-map', | |
| output: { | |
| path: __dirname+'/dist', | |
| filename: 'bundle.js', |