Skip to content

Instantly share code, notes, and snippets.

@ovrmrw
ovrmrw / index.html
Last active August 29, 2015 14:18
Angular Sample - Calculating Amount with Quantity and Price
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Angular Sample</title>
</head>
<body ng-app="myApp">
<div ng-controller="myController">
<div>
@ovrmrw
ovrmrw / People.json
Last active August 29, 2015 14:07
sample: Knockout+Node+Express+ArangoDB+Foxx
/* This is a sample data from full JSON file. */
{
"gender": "male",
"name": {
"first": "Eddy",
"last": "Mungin"
},
"birthday": "1962-01-20",
"memberSince": "2009-03-10",
@ovrmrw
ovrmrw / first.ts
Last active August 29, 2015 14:07
sample: Knockout in Node+Express
declare var ko: any;
class Formula {
a: any = ko.observable(3);
b: any = ko.observable(4);
sum: any = ko.observable(null);
// 'sum' is changed with this ko.computed().
private controlSum: Function = ko.computed(() => {
var a: number = Number(this.a()), // Don't forget to cast to number.
@ovrmrw
ovrmrw / app+.js
Last active March 9, 2016 20:29
sample: ArangoDB's Foxx controller with using any library you want
(function() {
"use strict";
var Foxx = require("org/arangodb/foxx"),
controller = new Foxx.Controller(applicationContext),
_ = require("underscore"), // loading underscore.js in C:\Program Files\ArangoDB 2.2.4\share\arangodb\js\node\node_modules
moment = require("moment"); // loading moment.js in C:\Program Files\ArangoDB 2.2.4\share\arangodb\js\node\node_modules
controller.get("/hello/:name", function(req, res) {
res.set("Content-Type", "text/plain");
@ovrmrw
ovrmrw / foxx_controller_sample.js
Last active August 29, 2015 14:07
sample: ArangoDB's Foxx controller
(function() {
"use strict";
var Foxx = require("org/arangodb/foxx"),
controller = new Foxx.Controller(applicationContext)
controller.get("/hello/:name", function(req, res) {
res.set("Content-Type", "text/plain");
res.body = "Hello " + req.params("name");
});