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
require 'aws-sdk' | |
ses = AWS.ses | |
AWS.config( | |
:access_key_id => '..', | |
:secret_access_key => '.., | |
:server => '..') | |
#puts ses.identities.map(:&identity) | |
ses.send_email(subject: "Hi", | |
from: "[email protected]", |
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
begin | |
# code that raise an error | |
# or an exception | |
rescue Exception => e | |
# e is an Exception object contains | |
# information of the error | |
# e.message is the information | |
# about why error occurred and | |
# which object caused the error, | |
# where e.backtrace(Array) holds |
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
begin | |
# code that raise an Error | |
# or an Exception | |
rescue StandardError => e | |
# Exceptions are not rescued. But, | |
# StandardError and subclasses | |
# of StandardError are rescued | |
puts e.message, e.backtrace, | |
# puts e.full_message, e.backtrace_locations | |
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
# let say you have a class Game and its Audio | |
module Audio | |
class NoDeviceError < Error::ENODEV # (No such device) | |
end | |
end | |
class Game | |
include Audio | |
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
begin | |
puts "a" * 5 # => "aaaaa" | |
puts 1 + "" # => TypeError (string can't be coerced into Integer) | |
puts 5 * "a" # => Never Evaluate | |
rescue TypeError => e | |
puts e.message, e.backtrace | |
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
import 'package:flutter/material.dart'; | |
void main() => runApp(new Keeper()); | |
class Keeper extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
title: 'Keeper', | |
home: new KeeperDrawer(), |
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
import 'package:flutter/material.dart'; | |
const String _AccountName = 'Aravind Vemula'; | |
const String _AccountEmail = '[email protected]'; | |
const String _AccountAbbr = 'AV'; | |
void main() => runApp(new Keeper()); | |
class Keeper extends StatelessWidget { | |
@override |
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
import 'package:flutter/material.dart'; | |
const String _AccountName = 'Aravind Vemula'; | |
const String _AccountEmail = '[email protected]'; | |
const String _AccountAbbr = 'AV'; | |
void main() => runApp(new Keeper()); | |
class Keeper extends StatelessWidget { | |
@override |
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
import 'package:flutter/material.dart'; | |
const String _AccountName = 'Aravind Vemula'; | |
const String _AccountEmail = '[email protected]'; | |
const String _AccountAbbr = 'AV'; | |
void main() => runApp(new Keeper()); | |
class Keeper extends StatelessWidget { | |
@override |
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
Navigator.of(context).push( | |
new PageRouteBuilder( | |
pageBuilder: (BuildContext context, _, __) { | |
return new Notes(); | |
}, | |
transitionsBuilder: (_, Animation<double> animation, __, Widget child) { | |
return new FadeTransition( | |
opacity: animation, | |
child: child | |
); |
OlderNewer