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> | |
| <head> | |
| <title>Stay Standalone</title> | |
| <meta name="apple-mobile-web-app-capable" content="yes"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> | |
| <script src="stay_standalone.js" type="text/javascript"></script> | |
| </head> | |
| <body> | |
| <ul> | |
| <li><a href="http://google.com/">Remote Link (Google)</a></li> |
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
| module Jekyll | |
| class RawTag < Liquid::Block | |
| def parse(tokens) | |
| @nodelist ||= [] | |
| @nodelist.clear | |
| while token = tokens.shift | |
| if token =~ FullToken | |
| if block_delimiter == $1 | |
| end_tag |
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
| The regex patterns in this gist are intended to match any URLs, | |
| including "mailto:[email protected]", "x-whatever://foo", etc. For a | |
| pattern that attempts only to match web URLs (http, https), see: | |
| https://gist.github.com/gruber/8891611 | |
| # Single-line version of pattern: | |
| (?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’])) |
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
| # A rake task to pull all your gists from github.com as html. | |
| # | |
| # This has advantages over the script embed: | |
| # * the script uses document.write, which is not compatible with XHTML Strict 1.0 | |
| # * document.write also can't be used after the document body has loaded (ie. no AJAX) | |
| # * the gists get indexed by search engines this way | |
| desc "Pull all gists from github and cache them locally" | |
| task :gists do | |
| uri = URI.parse 'http://gist.github.com/api/v1/yaml/gists/heisters' | |
| html = YAML.load(Net::HTTP.get(uri))['gists'].inject('') do |h, gist| |
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
| require 'digest/md5' | |
| def gfm(text) | |
| # Extract pre blocks | |
| extractions = {} | |
| text.gsub!(%r{<pre>.*?</pre>}m) do |match| | |
| md5 = Digest::MD5.hexdigest(match) | |
| extractions[md5] = match | |
| "{gfm-extraction-#{md5}}" | |
| end |
NewerOlder