Task | Java | Clojure |
---|---|---|
Instantiation | new Widget(“Foo”) | (Widget. “Foo”) |
Instance method | rnd.nextInd() | (.nextInt rnd) |
Instance field | object.field | (.-field object) |
Static method | Math.Sqrt(25) | (Math/sqrt 25) |
Static field | Math.PI | (Math/PI) |
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/sh | |
set -e | |
TAR_FILE="/tmp/goreleaser.tar.gz" | |
RELEASES_URL="https://github.com/goreleaser/goreleaser/releases" | |
TMP_DIR="/tmp/" | |
last_version() { | |
curl -sL -o /dev/null -w %{url_effective} "$RELEASES_URL/latest" | | |
rev | |
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
## start server foobar.mydomain.com | |
server { | |
server_name foobar.mydomain.com ; | |
listen 80; | |
listen [::]:80; | |
set $proxy_upstream_name "-"; | |
location / { | |
log_by_lua_block { | |
} | |
port_in_redirect off; |
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
apiVersion: extensions/v1beta1 | |
kind: Ingress | |
metadata: | |
annotations: | |
kubernetes.io/ingress.class: nginx | |
name: foobar | |
namespace: default | |
spec: | |
rules: | |
- host: foobar.mydomain.com |
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
controller: | |
ingressClass: nginx | |
service: | |
annotations: | |
cloud.google.com/load-balancer-type: Internal |
Traditionally, most of infrastructure is managed manually or by using scripts. This inconsistency causes many issues in infrastructure. TDD is known for increasing code quality, improving overall design, and allowing safe refactoring throughout a project. Explaining about how, why and which tools we should use to test code. So, I am going to explain about the how and why we should test our code and what are tools are available to test our infrastructure code.
Before Getting into actual usage of tool we should understand the phases of
- Pre-convergence: Testing phase that does not require any node to run the test.
- Convergence: Chef runs and make changes to the system on node.
- Post-convergence: Node finishes running Chef, also verifying that node is in the desired state.
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
# coding: utf-8 | |
lib = File.expand_path('../lib', __FILE__) | |
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | |
require 'google_client/version' | |
Gem::Specification.new do |spec| | |
spec.name = "google-client" | |
spec.version = GapiClient::VERSION | |
spec.authors = ["praveen shukla"] | |
spec.email = ["[email protected]"] |
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 main | |
import "fmt" | |
type Rectangle struct { | |
length, width int | |
} | |
func (r *Rectangle) Area() int { | |
return r.length * r.width |
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 main | |
import "fmt" | |
type Shaper interface { | |
Area() int | |
} | |
type Rectangle struct { | |
length, width int |
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
Rectangle is: {4 3} | |
Rectangle area is: 12 |
NewerOlder