In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
This file contains hidden or 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
// In the main process. | |
const { BrowserView, BrowserWindow } = require('electron') | |
let win = new BrowserWindow({ width: 800, height: 600 }) | |
win.on('closed', () => { | |
win = null | |
}) | |
let view = new BrowserView({ | |
webPreferences: { |
This file contains hidden or 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 com.mkyong.java8; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
public class TestJava8 { | |
public static void main(String[] args) { |
(Also see [remarkable][], the markdown parser created by the author of this cheatsheet)
This file contains hidden or 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
PROJECT_NAME := "do-snapshot-pruner" | |
.SHELLFLAGS = -c # Run commands in a -c flag | |
.ONESHELL: ; # recipes execute in same shell | |
.NOTPARALLEL: ; # wait for this target to finish | |
.EXPORT_ALL_VARIABLES: ; # send all vars to shell | |
.DEFAULT_GOAL:=help | |
.PHONY: fmt lint vet test test-cover build-docker release help |
This file contains hidden or 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
image: golang:1.11 | |
variables: | |
TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA | |
RELEASE_CI_REGISTRY: registry.hub.docker.com | |
RELEASE_IMAGE: $RELEASE_CI_REGISTRY/brpaz/gitlab-mr-commenter:$CI_COMMIT_TAG | |
RELEASE_IMAGE_LATEST: $RELEASE_CI_REGISTRY/brpaz/gitlab-mr-commenter:latest | |
stages: | |
- test |
This file contains hidden or 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
import { shallowMount } from '@vue/test-utils'; | |
import HelloWorld from '@/components/HelloWorld.vue'; | |
describe('HelloWorld.vue', () => { | |
it('renders props.msg when passed', () => { | |
const msg = 'new message'; | |
const wrapper = shallowMount(HelloWorld, { | |
propsData: { msg }, | |
}); | |
expect(wrapper.text()).toMatch(msg); |
This file contains hidden or 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
if err != nil { | |
switch err.(type) { | |
case *ErrZeroDivision: | |
fmt.Println(err.Error()) | |
default: | |
fmt.Println("What the h* just happened?") | |
} | |
} |
This file contains hidden or 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
func main() { | |
u := User{Id: "US123", Balance: 8} | |
b := new(bytes.Buffer) | |
json.NewEncoder(b).Encode(u) | |
res, _ := http.Post("https://httpbin.org/post", "application/json; charset=utf-8", b) | |
var body struct { | |
// httpbin.org sends back key/value pairs, no map[string][]string | |
Headers map[string]string `json:"headers"` | |
Origin string `json:"origin"` | |
} |