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
public String trim(String value, int maxLength) { | |
return value.substring(0, Math.min(value.length(), maxLength)); | |
} |
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
@SafeVarargs | |
public final <T> T oneOf(T... values) { | |
return values[faker.number().numberBetween(0, new Random().nextInt(values.length))]; | |
} |
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
# service configuration example | |
[Unit] | |
Description=AppName | |
Requires=network.target | |
[Service] | |
Type=simple | |
User=your_user_name | |
Group=your_user_group |
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 CreatePlaces < ActiveRecord::Migration[5.1] | |
def change | |
create_table :places do |t| | |
t.decimal "lat", precision: 10, scale: 6 | |
t.decimal "lng", precision: 10, scale: 6 | |
end | |
end | |
end |