2017-06-20
My notes from Alistair in the 'hexagone', a cross-over meetup event mixing:
With @TotherAlistair and @tpierrain.
InvalidateCacheProject: | |
Type: AWS::CodeBuild::Project | |
Properties: | |
Artifacts: | |
Type: CODEPIPELINE | |
Environment: | |
ComputeType: BUILD_GENERAL1_SMALL | |
Image: aws/codebuild/standard:2.0 | |
Type: LINUX_CONTAINER | |
Name: !Sub ${AWS::StackName}-invalidate-cache |
require('dotenv').config(); | |
//require("lambda") | |
var http = require("request"), | |
_ = require("lodash"), | |
async = require("async"), | |
moment = require('moment'), | |
elasticsearch = require('elasticsearch'), | |
elastic = new elasticsearch.Client({ | |
host: process.env.ES | |
}) |
const fs = require('fs'); | |
const path = require('path'); | |
const AWS = require('aws-sdk'); | |
const { BUCKET_NAME, AWS_ACCESS_ID, AWS_SECRET_KEY } = process.env; | |
// helpers | |
function uploadToS3(file, name, type) { |
node('yona'){ | |
stage('Build'){ | |
... | |
} | |
} | |
stage('Decide tag on Docker Hub'){ | |
env.TAG_ON_DOCKER_HUB = input message: 'User input required', | |
parameters: [choice(name: 'Tag on Docker Hub', choices: 'no\nyes', description: 'Choose "yes" if you want to deploy this build')] | |
} | |
if (env.TAG_ON_DOCKER_HUB == 'yes'){ |
2017-06-20
My notes from Alistair in the 'hexagone', a cross-over meetup event mixing:
With @TotherAlistair and @tpierrain.
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" /> | |
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" /> | |
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/_build/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" /> | |
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/deps/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" /> |
/** | |
* Filters an array of objects using custom predicates. | |
* | |
* @param {Array} array: the array to filter | |
* @param {Object} filters: an object with the filter criteria | |
* @return {Array} | |
*/ | |
function filterArray(array, filters) { | |
const filterKeys = Object.keys(filters); | |
return array.filter(item => { |
Monitoring is critical to a well-functioning production system. OS-level metrics like CPU load and RAM usage are a good start, but you'll eventually want to record application-level metrics like how long it's taking you to service each HTTP request, or how much time is spent in garbage collection. Once tracked, this data can be used by humans and machines (like monitoring systems) to gain insight into how your app is running.
In this post I'll show how you can use EKG, a popular Haskell metrics library, to add application-level metrics to your Yesod app.
EKG allows reporting four different types of metrics from your app:
/* | |
This example shows how you can use your data structure as a basis for | |
your Firebase security rules to implement role-based security. We store | |
each user by their Twitter uid, and use the following simplistic approach | |
for user roles: | |
0 - GUEST | |
10 - USER | |
20 - MODERATOR |