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
# Rest of file skipped! | |
release :myapp do | |
set config_providers: [ | |
{EnvironmentConfigProvider, %{env_var_name: "SERVICE_ENVIRONMENT", persist: [:myapp, :service_environment]}} | |
] | |
end |
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
defmodule EnvironmentConfigProvider do | |
use Mix.Releases.Config.Provider | |
@impl Provider | |
def init(%{env_var_name: var_name, persist: [app, config_variable]}) do | |
value = System.get_env(var_name) || raise "No value provided for ENV variable #{var_name}" | |
Application.put_env(app, config_variable, value, persistent: true) | |
end | |
end |
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
use Mix.Config | |
# This does not always work! | |
config :myapp, service_environment: System.get_env("SERVICE_ENVIRONMENT") |
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
function! UmbrellaElixirTestTransform(cmd) abort | |
if a:cmd !~ 'apps/' | |
return a:cmd | |
endif | |
let testCommand = join(split(a:cmd)[0:-2]) | |
let umbrellaTestFilePath = split(a:cmd)[-1] | |
let pathFragments = split(umbrellaTestFilePath, "/") | |
let appName = pathFragments[1] | |
let localTestPath = join(pathFragments[2:], "/") |
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
defmodule Maps do | |
def shortmap do | |
%{a: "b", c: "d"} | |
end | |
def longmap do | |
x = %{ | |
foo: "bar", | |
baz: "1", |
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
app: | |
build: . | |
volumes: | |
- /qgen/public | |
environment: | |
- RAILS_ENV=production | |
env_file: | |
- envfile.${ENV} | |
proxy: |
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
app.factory('Authentication', function($http, $rootScope, $location, $timeout){ | |
var Auth = {}; | |
Auth.unsetUser = function() { | |
$rootScope.user = {}; | |
}; | |
Auth.setUser = function(data) { | |
$rootScope.user = data; |
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
app.factory('ArrayService', function(){ | |
return { | |
deleteElement: function(array, element) { | |
var index = array.indexOf(element); | |
if(index == -1){ | |
return false; | |
} | |
array.splice(index, 1); |