- Download the installer from the page https://golang.org/dl/ and install the package.
Type go
in terminal, to verify the installation.
- Create a Go workspace and set GO PATH
Type go
in terminal, to verify the installation.
# .circleci/config.yml | |
version: 2 | |
defaults: &defaults | |
working_directory: ~/app | |
docker: | |
# the Docker image with Cypress dependencies | |
- image: cypress/base:8 | |
environment: | |
## this enables colors in the output | |
TERM: xterm |
export const actions = { | |
async nuxtServerInit ({ dispatch }, { app }) { | |
console.log('calling init methods') | |
await dispatch('providers/nuxtServerInit', { app }) | |
await dispatch('products/nuxtServerInit', { app }) | |
} | |
} |
Currently the godotenv library doesn't support loading different .env files such as .env.test for testing .env.staging for staging.
Here's the small snippet, to support different environments file dynamically. Based on the @adamcohen comment.(option 1)
joho/godotenv#43 - Follow this issue for future changes
# Database cleaner configuration for apps using both mongoid and activerecord. | |
When your apps using multiple ORMs, you might want to fine tune each ORM in different way. | |
This contains the sample configuration for using mongoid and activerecord together. | |
This shows how to use different startegy for different ORMs. |
def insert(new_node) | |
if tail == nil | |
new_node.next = new_node | |
tail = new_node | |
else | |
curr = tail.next | |
while curr.next != tail && curr.data <= new_node.data | |
curr = curr.next |
#Brian Kernighan’s algorithm | |
def count_set_bits(num) | |
count = 0 | |
while num != 0 | |
num &= (num-1) | |
count += 1 | |
end | |
count | |
end |