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
/** | |
* Below are several examples of methods that are difficult to clearly annotate with JSDoc annotations. | |
*/ | |
/** | |
* @param {Object} people An index of people keyed by a person's name | |
* @returns {Object} map An index of zipcodes keyed by a person's name | |
*/ | |
function find(people) { |
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
import os | |
import shutil | |
import fiftyone as fo | |
import fiftyone.zoo as foz | |
import fiftyone.utils.image as foui | |
fo.core.dataset.delete_non_persistent_datasets() | |
exampleName = 'thumbnail-example' |
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
/** | |
* Dependencies | |
*/ | |
var request = require('request'); | |
var loopback = require('loopback'); | |
var app = loopback(); | |
var memoryDataSource = loopback.memory(); | |
var HEADER_NAME = 'x-access-token'; // subject to change |
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
interface Envelope { | |
writeToResponse() | |
} | |
class File extends Envelope { | |
writeToResponse(res) { | |
res.setHeader('content-type', this.getContentType()) | |
this.readableStream.pipe(res) | |
} | |
} |
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 $ = exports | |
$.GENERATORS = [ | |
'package', | |
'app', | |
'error', | |
'start', | |
'resource', | |
'view', | |
'orm', |
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 co = require('co'); | |
var thunk = require('thunkify'); | |
var loopback = require('loopback'); | |
var memory = loopback.memory(); | |
var product = memory.createModel('memory'); | |
// thunkify the loopback model | |
thunkify(); | |
// create some products in parallel |
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
// UserRepository and User do not exist in the sdk | |
UserRepository repository = adapter.createRepository(UserRepository.class); | |
HashMap attributes = new HashMap<String, Object>(); | |
attributes.put("email", "me@domain.com"); | |
attributes.put("password", "secret"); | |
User me = repository.createModel(attributes); | |
me.save(new Model.Callback() { | |
@Override | |
public void onSuccess() { |
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
// DAO | |
function create(obj, callback) { | |
var Model = this; | |
var ctx = new EventEmitter(); | |
ctx.data = obj; | |
ctx.callback = callback; | |
Model.emit('create:start', ctx); | |
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
<!-- | |
An Angular View to render a list of Restaurants | |
--> | |
<table class="table table-hover table-striped" ng-controller="RestaurantsController"> | |
<tr ng-repeat="restaurant in restaurants"> | |
<td> | |
<a href="#/menu/{{restaurant.id}}"> | |
<img class="img-rounded pull-left" ng-src="img/restaurants/{{restaurant.shortName}}.jpg"> | |
<b>{{restaurant.name}}</b> | |
</a> |
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
app.controller('RestaurantsController', | |
function RestaurantsController(Restaurant) { | |
$scope.restaurants = Restaurant.query(filterAndSortRestaurants); | |
}); |
NewerOlder