<body ng-controller="StoryController as vm">
<h3>{{ vm.story.name }}</h3>
<h3 ng-bind="vm.story.name"></h3>
</body>
linters-settings: | |
govet: | |
check-shadowing: true | |
settings: | |
printf: | |
funcs: | |
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof | |
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf | |
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf | |
- (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
public class Constants { | |
/** | |
* Contains the path to your Lambda function code. | |
*/ | |
public static final String LAMBDA_TASK_ROOT = System.getenv("LAMBDA_TASK_ROOT"); | |
/** | |
* The environment variable is set to one of the following options, depending on the runtime of the Lambda function: | |
* AWS_Lambda_nodejs, AWS_Lambda_nodejs4.3, AWS_Lambda_nodejs6.10 |
// by: throw_away_stacy on reddit | |
// and yes I do birthday parties too | |
const WebSocket = require('websocket').w3cwebsocket; | |
const users = require('./users.json'); | |
const Q = require('q'); | |
const superagent = require('superagent'); | |
const _ = require('highland'); | |
const getPixels = require('get-pixels'); |
package main | |
// A simple demo implementation of a Redis job queue in Go inspired on http://stackoverflow.com/a/34754632 | |
// You'll need to get redis driver package in terminal with: go get -u gopkg.in/redis.v5 | |
// Once it is running, Redis should look like: http://i.imgur.com/P4XlwlP.png | |
// Terminal should look like: http://i.imgur.com/AS2IIbP.png | |
// I have 4 days of Go programming experience, have mercy. | |
import ( | |
"fmt" |
func fibonacci_seq() func() int { | |
f1, f2 := 0, 1 | |
return func() int { | |
f1, f2 = f2, f1 + f2 | |
return f2 | |
} | |
} |
package main | |
import "fmt" | |
// 定义接口类型 PeopleGetter 包含获取基本信息的方法 | |
type PeopleGetter interface { | |
GetName() string | |
GetAge() int | |
} |
/* Exercise: Loops and Functions #43 */ | |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(2.) |
While attempting to explain JavaScript's reduce
method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List
is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and
/* jshint node: true */ | |
var assert = require("assert"); | |
/* | |
* fn | |
* | |
* @return {Function} | |
*/ |