Opinions are like assholes, every one has got one.
This one is mine.
Punctuation is a bikeshed. Put your semicolons, whitespace, and commas where you like them.
const nodeCloud = require('../nodecloud/lib/'); | |
const ncAWS = nodeCloud.getProvider('AWS', process.env.ncconf); | |
const options = { | |
apiVersion: '2016-11-15', | |
}; | |
const params = { | |
ImageId: 'ami-10fd7020', | |
InstanceType: 't1.micro', | |
MinCount: 1, | |
MaxCount: 1, |
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
const assert = require('chai').assert; | |
const ghFollowers = require('../index'); | |
describe('github-followers', function() { | |
it('should return an array of objects', function(done) { | |
ghFollowers('rajikaimal') | |
.then(res => { | |
assert.typeOf(res, 'array'); | |
done(); | |
}) |
const httpFetcher = require('http-fetcher'); | |
const ghURI = '/users/:username/followers'; | |
module.exports = function(username) { | |
const URI = ghURI.replace(':username', username); | |
return httpFetcher('api.github.com', URI, { 'User-Agent': 'github-followers' }, 'https'); | |
} |
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Http\Requests; | |
use App\Http\Controllers\Controller; | |
use App\Tweet; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Laravel-React</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react-dom.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | |
<script type="text/babel" src="js/main.js"></script> | |
</head> |
//add extra extension to render pure html alongside with php | |
View::addExtension('html', 'php'); | |
Route::get('/blog', function() { | |
return view('Blog'); | |
}); | |
//route for inserting | |
Route::post('/tweets/create', 'BlogController@create'); | |
//route for deleting | |
Route::post('/tweets/delete', 'BlogController@delete'); |
mutation { | |
AddUser ( | |
_id: 2, | |
name: "Taeyeon", | |
age: 26 | |
) { | |
_id, | |
name | |
} | |
} |
query ExampleQuery(presents: Boolean) { | |
ExampleRootQueryField { | |
...ConditionalFragment @include(if: presents) | |
} | |
} | |
fragment ConditionalFragment on ExampleType { | |
_id, | |
firstname, | |
speciality |