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
[Unit] | |
Description=Network Connectivity | |
Wants=network.target | |
Before=network.target | |
BindsTo=sys-subsystem-net-devices-lan0.device | |
After=sys-subsystem-net-devices-lan0.device | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes |
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
# Copy and paste this into a terminal: | |
gem install minimapper | |
gem install activemodel # required for Minimapper::Entity[::Rails] (you can use Minimapper::Entity::Core without it) | |
curl https://gist.github.com/joakimk/3904952/raw/56b592e6eaa5a0206bf9207b0ee53aa0114a53eb/minimapper_example.rb > minimapper_example.rb | |
ruby minimapper_example.rb |
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
rescue = do(console) -> | |
(expression, fallback) -> | |
try expression?() || expression | |
catch e | |
console?.warn?( 'Rescued from', e, '. Using fallback value', fallback ) | |
return fallback |