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
### | |
### YAML Showcase | |
### Thanks for http://jp.rubyist.net/magazine/?0009-YAML | |
### To run: | |
### cat $0 | ruby -r pp -r yaml -e 'pp YAML.load STDIN.read' | |
### | |
collection: | |
mapping(block-style): | |
name: Taro | |
age: 32 |
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 'hpricot' | |
require 'open-uri' | |
doc = Hpricot( open("https://commons.wikimedia.org/wiki/Crystal_Clear").read ) | |
(doc/:a).each do |link| | |
puts link[:href] | |
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
#!/usr/bin/ruby | |
=begin | |
Script to generate scss for color-wheel. | |
=end | |
$saturation = ARGV[0] || 100 | |
$luminousness = ARGV[1] || 50 | |
$split = ARGV[2].to_i || 24 | |
def mk_suffix(deg) | |
"#{deg}_#{$saturation}_#{$luminousness}" |
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
#!/bin/sh | |
## | |
## Publish onto Github Pages, providing an easy way to publish. | |
## | |
## Prepare: creating gh-pages branch at local and remote. | |
## $ jekyll | |
## $ git co -b gh-pages | |
## $ git ls-files | xargs git rm | |
## $ mv _site/* . | |
## $ git add . |
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
=begin | |
Jekyll tag to include Markdown text from _includes directory preprocessing with Liquid. | |
Usage: | |
{% markdown <filename> %} | |
Dependency: | |
- kramdown | |
=end | |
module Jekyll | |
class MarkdownTag < Liquid::Tag | |
def initialize(tag_name, text, tokens) |
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
<link href="http://tmtk75.github.com/jumly-core/jumly-0.1.0-rc1.min.css" type="text/css" rel="stylesheet"/> | |
<script src='http://code.jquery.com/jquery-1.7.1.min.js' type="text/javascript"></script> | |
<script src='http://jashkenas.github.com/coffee-script/extras/coffee-script.js' type="text/javascript"></script> | |
<script src="http://tmtk75.github.com/jumly-core/jumly-0.1.0-rc1.min.js" type="text/javascript"></script> |
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
{% jumly_includes %} |
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
{% jumly sequence %} | |
@found "You", -> | |
@message "Hello!", "JUMLY" | |
{% endjumly %} |
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
--- | |
layout: default | |
--- | |
<head> | |
{% jumly_includes %} | |
</head> | |
<body> | |
{% jumly sequence %} | |
@found "You", -> @message "Hello!", "JUMLY" | |
{% endjumly %} |
OlderNewer