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
#!/bin/env perl | |
use strict; | |
use warnings; | |
use AnyEvent::Twitter::Stream; | |
use EV; | |
use utf8; | |
use YAML; | |
use FindBin qw($Bin); | |
use Data::Dumper; |
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
package Homenotes; | |
use Mojo::Base 'Mojolicious'; | |
use Mojolicious::Plugin::Web::Auth; | |
use Plack::Session; | |
use Data::Dumper; | |
use FindBin qw($Bin); | |
sub startup { | |
my $self = shift; |
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.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
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
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_; | |
})); |
OlderNewer