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
/* lazyload.js (c) Lorenzo Giuliani | |
* MIT License (http://www.opensource.org/licenses/mit-license.html) | |
* | |
* expects a list of: | |
* `<img src="blank.gif" data-src="my_image.png" width="600" height="400" class="lazy">` | |
*/ | |
!function(window){ | |
var $q = function(q, res){ | |
if (document.querySelectorAll) { |
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
#!/usr/bin/env ruby | |
require 'pygmentize' # gem install pygmentize | |
require 'selenium-webdriver' # gem install selenium-webdriver | |
exit unless code_path = ARGV.shift | |
file_path = File.absolute_path 'code.html' | |
image_path = File.absolute_path 'code_image.png' | |
code = Pygmentize.process File.read(code_path), :ruby | |
html = <<-EOT |