-
toBe: represents the exact equality (===) operator.
-
toEqual: represents the regular equality (==) operator.
-
toMatch: calls the RegExp match() method behind the scenes to compare string data.
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
class BoggleBoard | |
def initialize(dice_grid) | |
@board = dice_grid | |
end | |
def create_word(*coords) | |
coords.map { |coord| @board[coord.first][coord.last] }.join("") | |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>DOM manipulation with jQuery</title> | |
<!-- Add a link to jQuery CDN here script here --> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script type="text/javascript" src="jquery_example.js"></script> | |
</head> |
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
%a - The abbreviated weekday name (''Sun'') | |
%A - The full weekday name (''Sunday'') | |
%b - The abbreviated month name (''Jan'') | |
%B - The full month name (''January'') | |
%c - The preferred local date and time representation | |
%d - Day of the month (01..31) | |
%H - Hour of the day, 24-hour clock (00..23) | |
%I - Hour of the day, 12-hour clock (01..12) | |
%j - Day of the year (001..366) | |
%m - Month of the year (01..12) |
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.geolocation.getCurrentPosition(function(position) { | |
console.log(position.coords.latitude, position.coords.longitude); | |
}); |
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 'httparty' | |
require 'json' | |
def handle_follow_response(response) | |
new_id = response["follow"].match(/\d+/) | |
append_to_url = "id=#{new_id}" | |
puts response | |
get_new_json_response(append_to_url) | |
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
@IBAction func showDeleteActionSheet(_ sender: AnyObject) { | |
let alertController = UIAlertController(title: nil, message: "Alert message.", preferredStyle: .actionSheet) | |
let defaultAction = UIAlertAction(title: "Default", style: .default, handler: { (alert: UIAlertAction!) -> Void in | |
// Do some action here. | |
}) | |
let deleteAction = UIAlertAction(title: "Delete", style: .destructive, handler: { (alert: UIAlertAction!) -> Void in | |
// Do some destructive action here. | |
}) |
OlderNewer