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
def select_from_chosen(item_text, options) | |
field = find_field(options[:from]) | |
option_value = page.evaluate_script("$(\"##{field[:id]} option:contains('#{item_text}')\").val()") | |
page.execute_script("$('##{field[:id]}').val('#{option_value}')") | |
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
class Foo | |
def self.foo | |
"foo" | |
end | |
def foo | |
"ifoo" | |
end | |
def true_foo | |
Foo.foo | |
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 FibAgent do | |
def start_link do | |
cache = Enum.into([{0, 0}, {1, 1}], HashDict.new) | |
Agent.start_link(fn -> cache end) | |
end | |
def fib(pid, n) when n >= 0 do | |
Agent.get_and_update(pid, &do_fib(&1, n)) | |
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
augroup elixir | |
au! | |
au BufNewFile,BufRead *.ex,*.exs noremap <buffer> <leader>t :!mix test %<cr> | |
au BufNewFile,BufRead *_test.exs noremap <buffer> <leader>t :!mix test %<cr> | |
augroup 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 FibAgent do | |
defstruct cache: nil, highest_n: 0 | |
def start_link do | |
initial_cache = Enum.into([ {0, 0}, {1, 1}], HashDict.new) | |
state = %__MODULE__{cache: initial_cache, highest_n: 1} | |
Agent.start_link(fn -> state end, name: __MODULE__) | |
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
user www-data; | |
worker_processes 4; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
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/bash | |
cat ./id_rsa.pub | ssh -p 29418 styx.mp@192.168.11.11 gerrit create-account --ssh-key - jenkins --full-name "Leeroy\ Jenkins" --email jenkins@domain.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
Rails.application.assets.find_asset('mail.css').body | |
include Sprockets::Helpers::RailsHelper | |
include Sprockets::Helpers::IsolatedHelper | |
include ActionView::Helpers::AssetTagHelper |
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
test/eex_test.exs:213: warning: missing specification for function 'test respects line number inside middle expressions with keywords'/1 | |
test/eex_test.exs:235: warning: missing specification for function 'test properly handle functions'/1 | |
test/eex_test.exs:255: warning: missing specification for function 'test do not consider already finished functions'/1 | |
test/eex_test.exs:275: warning: missing specification for function 'test evaluates nested do expressions'/1 | |
test/eex_test.exs:290: warning: missing specification for function 'test for comprehensions'/1 | |
test/eex_test.exs:299: warning: missing specification for function 'test unicode'/1 | |
test/eex_test.exs:308: warning: missing specification for function 'test evaluates the source from a given file'/1 | |
test/eex_test.exs:314: warning: missing specification for function 'test evaluates the source from a given file with bindings'/1 | |
test/eex_test.exs:320: warning: missing specification for function 'test raises an Exception when there\'s an error with the given file |
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
DISABLED_TASKS = [ | |
'db:drop', | |
'db:migrate:reset', | |
'db:schema:load', | |
'db:seed', | |
# ... | |
] | |
namespace :db do | |
desc "Disable a task in production environment" |
OlderNewer