#!/bin/sh | |
# Get current branch name | |
branch_name="$(git rev-parse --symbolic-full-name --abbrev-ref HEAD)" | |
# Replace or add the board name abbreviations here | |
jira_abbreviations=("JIRA_BOARD_ABBREVIATION") | |
# Check if current branch is a feature branch i.e. starts with a ticket number | |
check_is_issue_branch () { | |
for abbrv in "${jira_abbreviations[@]}" |
let rects = []; | |
function visualize(analyser) { | |
analyser.fftSize = 2048; | |
var bufferLength = analyser.fftSize; | |
var dataArray = new Uint8Array(bufferLength); | |
function run() { | |
analyser.fftSize = 2048; | |
var bufferLengthAlt = analyser.frequencyBinCount; |
A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.
This is specific to k8s and containers that have CPU limits set.
To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:
sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
#! /bin/bash | |
# ECHO COMMAND | |
# echo Hello World! | |
# VARIABLES | |
# Uppercase by convention | |
# Letters, numbers, underscores | |
NAME="Bob" | |
# echo "My name is $NAME" |
# Use envFrom to load Secrets and ConfigMaps into environment variables | |
apiVersion: apps/v1beta2 | |
kind: Deployment | |
metadata: | |
name: mans-not-hot | |
labels: | |
app: mans-not-hot | |
spec: | |
replicas: 1 |
Git is the key tool we use to allow multiple people to work on the same code base. Git takes care of merging everyone's contributions smoothly. Hence, learning how to use Git is critical to contributing to open source.
Exercise 1: Go through the Try Git Guide
Exercise 2: Learn How to file a github issue.
"Programs should be written for people to read, and only incidentally for machines to execute." -- Structure and Interpretation of Computer Programs
"How would you define good code? [...] After lots of interviews we started wondering if we could come out with a definition of good code following a pseudo-scientific method. [...] The population is defined by all the software developers. The sample consists of 65 developers chosen by convenience. [...] The questionnaire consists in a single question: “What do you feel makes code good? How would you define good code?”. [...] Of those, the most common answer by far was that the code has to be Readable (78.46%), almost 8 of each 10 developers believe that good code should be easy to read and understand." -- "What is Good Code: A Scientific Definition"
Computer code is a series of executed statements. Frequently, these statements are executed one at a time. If one part of your code takes a long time to run, the rest of your code won't run until that part is finished.
However, this isn't how it has to be. We can often make the exact same code go much faster through parallelization, which is simply running different parts of the computer code simaltaneously.
The first example of this is asynchronous code. The idea here is that many times you do things like send a call to another computer, perhaps over the internet, using an API. Normally, code then has to simply wait for the other computer to give it a response over the API. But asynchronous code can simply keep on going and then the API call returns later.
This makes code harder to reason about and handle because you don't know when the API call will return or what your code will be like when it returns, but it makes your code faster because you don't have to wait arou
Looking at Rails, Angular, jQuery, Prediction.io, and Redis pages to find commonalities.
- Layout matters. A nice layout inspires trust in your project.
- Layout is similar. All the sites had a top bar with the prominent navigation. All the main pages had introductory text.
- GitHub Issues is used ubiquitously for bug tracking.
- IRC seems important for communities. Gitter seems like a good choice.