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
| it 'closes properly the dropdown associated to each option', js: :true do | |
| options.each do |option, code| | |
| show_dropdown(option) | |
| select_option(option, code) | |
| expect(dropdown_closed?(option)).to be true | |
| end | |
| end |
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
| LmsEmail.includes(:sender).where(sender: @sender) |
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
| module CodeEditor | |
| extend self | |
| def use_soft_tabs? | |
| evaluate_script("ground.editor.getSession().getUseSoftTabs();") | |
| end | |
| end |
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
| match 'grounds/', to: 'grounds#run', as: 'grounds_run', via: :put | |
| match 'grounds/:theme', to: 'grounds#switch_editor_theme', as: 'grounds_switch_editor_theme', via: :patch | |
| Prefix Verb URI Pattern Controller#Action | |
| root GET / grounds#show | |
| grounds_run PUT /grounds(.:format) grounds#run | |
| grounds_switch_editor_theme PATCH /grounds/:theme(.:format) grounds#switch_editor_theme |
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
| link_to(theme[:label], grounds_switch_editor_theme_path(theme[:code]), method: :patch, remote: true) |
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
| .ground-button { | |
| @extend .button.secondary; | |
| @include ground-border; | |
| &:hover { | |
| background-color: adjust-color($ground-primary-color, $lightness: -15%) | |
| } | |
| &:focus { | |
| background-color: adjust-color($ground-primary-color, $lightness: -25%) | |
| } |
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() { | |
| cmd := exec.Command(“stuff”) | |
| chan := make(chan int, 1) | |
| go func() { | |
| cmd.Run() | |
| chan <- STOP | |
| } | |
| go func() { | |
| sleep(5) |
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
| param := "stop" | |
| if api.APIVERSION.LessThan("1.14") { | |
| param = "force" | |
| } | |
| var param string | |
| if api.APIVERSION.LessThan("1.14") { | |
| param = "force" | |
| } else { | |
| param = "stop" |
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
| class User < ActiveRecord::Base | |
| validates :admin, last_stays: true | |
| end | |
| class LastStaysValidator < ActiveModel::EachValidator | |
| def validate_each(record, attribute, value) | |
| value_was = record.send("#{attribute}_was") | |
| # If last record with attribute was equal to true | |
| # it can't change this attribute value to false |
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 main | |
| import "code.google.com/p/go-tour/tree" | |
| import "fmt" | |
| func DoWalk(t *tree.Tree, ch chan int) { | |
| if t.Left != nil { | |
| DoWalk(t.Left, ch) | |
| } | |
| ch <- t.Value |