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: "aravind@classpro.in", |
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
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
# 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
import 'dart:convert'; | |
import 'package:flutter/material.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'package:http/http.dart' as http; | |
import 'auth_utils.dart'; | |
class NetworkUtils { | |
static final String host = productionHost; | |
static final String productionHost = 'https://authflow.herokuapp.com'; | |
static final String developmentHost = 'http://192.168.31.110:3000'; |
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 'dart:convert'; | |
import 'package:flutter/material.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'package:http/http.dart' as http; | |
import 'auth_utils.dart'; | |
class NetworkUtils { | |
static final String host = productionHost; | |
static final String productionHost = 'https://authflow.herokuapp.com'; | |
static final String developmentHost = 'http://192.168.31.110:3000'; |
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 'dart:convert'; | |
import 'package:flutter/material.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'package:http/http.dart' as http; | |
import 'auth_utils.dart'; | |
class NetworkUtils { | |
static final String host = productionHost; | |
static final String productionHost = 'https://authflow.herokuapp.com'; | |
static final String developmentHost = 'http://192.168.31.110:3000'; |
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 'dart:convert'; | |
import 'package:flutter/material.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'package:http/http.dart' as http; | |
import 'auth_utils.dart'; | |
class NetworkUtils { | |
static final String host = productionHost; | |
static final String productionHost = 'https://authflow.herokuapp.com'; | |
static final String developmentHost = 'http://192.168.31.110:3000'; |
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 'dart:convert'; | |
import 'package:flutter/material.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; | |
import 'package:http/http.dart' as http; | |
import 'auth_utils.dart'; | |
class NetworkUtils { | |
static final String host = productionHost; | |
static final String productionHost = 'https://authflow.herokuapp.com'; | |
static final String developmentHost = 'http://192.168.31.110:3000'; |
OlderNewer