This file contains 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
jQuery(function($) { | |
$(document).ready(function() { | |
$('#search').click(function(){ | |
mainSearch(); | |
}); | |
$('#submit').click(function(){ | |
var knowledge = {}; | |
knowledge.know = $('#know').val(); |
This file contains 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
(function(){ | |
//========================================================================= | |
// To avoid the conflict with Mojolicious's template | |
//========================================================================= | |
// _.templateSettings = { | |
// evaluate: /\{\{([\s\S]+?)\}\}/g, | |
// interpolate: /\{\{=([\s\S]+?)\}\}/g | |
// }; |
This file contains 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.routers.AppRouter = Backbone.Router.extend({ | |
routes: { | |
"": "home", | |
"employees/:id": "employeeDetails", | |
"employees/:id/reports": "reports", | |
"employees/:id/map": "map" | |
}, | |
initialize: function () { |
This file contains 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.models.Employee = Backbone.Model.extend({ | |
initialize:function () { | |
this.reports = new app.models.ReportsCollection(); | |
this.reports.parent = this; | |
}, | |
sync: function(method, model, options) { | |
if (method === "read") { | |
app.adapters.employee.findById(parseInt(this.id)).done(function (data) { |
This file contains 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.views.HomeView = Backbone.View.extend({ | |
initialize: function () { | |
this.searchResults = new app.models.EmployeeCollection(); | |
this.searchresultsView = new app.views.EmployeeListView({model: this.searchResults}); | |
}, | |
render: function () { | |
this.$el.html(this.template()); | |
$('.scroller', this.el).append(this.searchresultsView.render().el); |
This file contains 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
sub startup { | |
my $self = shift; | |
$self->types->type(json => 'application/json; charset=utf-8'); |
This file contains 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
#!/usr/bin/env perl | |
use Statistics::R; | |
my $R = Statistics::R->new(); | |
$R->set('x', 5); | |
$R->run(q`y <- x^2`); | |
my $output_value = $R->get('y'); | |
print "y = $output_value\n"; | |
$R->stop(); |
This file contains 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'; | |
describe('Testing Services', function () { | |
// Required setup for AngualarJS | |
beforeEach(module('frontieApp')); | |
var myOrder; | |
beforeEach(inject(function(_myOrder_){ | |
myOrder = _myOrder_; | |
})); |
This file contains 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
.factory('myOrder', function () { | |
var order = {}; | |
return { | |
init: function () { | |
order = {}; | |
}, | |
setStock: function(stock){ | |
order.stock = stock; | |
}, | |
getStock: function(){ |
This file contains 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
--- | |
- hosts: servers | |
user: root | |
tasks: | |
- name: add user | |
user: name=kamesho | |
- authorized_key: user=kamesho key="{{ lookup('file', '/Users/kamesho/.ssh/id_rsa.pub') }}" |