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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Five Squares Puzzle Demo</title> | |
| <style> | |
| body { | |
| margin: 0; | |
| font-family: Arial, sans-serif; |
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
| #!/usr/bin/env ruby | |
| require 'ferrum' | |
| require 'optparse' | |
| require 'uri' | |
| class WebScreenshotter | |
| def initialize(options = {}) | |
| @options = { | |
| width: 1920, |
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
| def fix_encoding(str) | |
| # The "b" method returns a copied string with encoding ASCII-8BIT | |
| str = str.b | |
| # Strip UTF-8 BOM if it's at start of file | |
| if str.byteslice(0..2) == "\xEF\xBB\xBF".b | |
| str = str.byteslice(3..-1) | |
| end | |
| if str.ascii_only? |
OlderNewer