Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick Johnstone Widdershin

View GitHub Profile
View js-in-md-checker.md

Testing JavaScript embedded in Markdown

  • Use case: Blog posts and books, not documentation for software.
  • As much code as possible should be included within the Markdown file.
  • I’m currently using § as a meta-character.
    • I’m open to alternatives. Other characters I considered: ¡ ¿ Δ ≡
    • I wanted it to be a non-ASCII character, to minimize the risk of conflicts.

Checking is opt-in

View kitchen_sync.rb
require "formula"
class KitchenSync < Formula
homepage "https://github.com/willbryant/kitchen_sync"
url "https://github.com/willbryant/kitchen_sync/archive/0.47.tar.gz"
sha1 "b222273ca35be5e6d9dd609cd1532d204c88cee0"
depends_on "cmake" => :build
depends_on "boost"
depends_on "yaml-cpp"
View 0.2.1-boggle_class_from_methods.rb
def sign(number)
if number > 0
return 1
elsif number < 0
return -1
end
0
end