This is a plugin meant for Jekyll.
Example use:
Easily embed a YouTube video. Just drop this file in your _plugins
directory.
{% youtube oHg5SJYRHA0 %}
module Jekyll | |
class MathJaxBlockTag < Liquid::Tag | |
def render(context) | |
'<script type="math/tex; mode=display">' | |
end | |
end | |
class MathJaxInlineTag < Liquid::Tag | |
def render(context) | |
'<script type="math/tex">' | |
end |
This is a plugin meant for Jekyll.
Example use:
Easily embed a YouTube video. Just drop this file in your _plugins
directory.
{% youtube oHg5SJYRHA0 %}
Ruby の HTTP クライアントライブラリ Faraday が便利そう
API ラッパの開発には [RestClient gem][rest_client_gem] だとか
OAuth の必要なものは [Net/HTTP][net_http] + [OAuth gem][oauth_gem] を使ってた
[Twitter gem][twitter_gem] や [Instagram gem][instagram_gem] など API ライブラリのソースを読んでみると
[Faraday gem][faraday_gem] というものがよく使われてた
$! raise された例外オブジェクト | |
$" require で読み込まれたファイルの配列 | |
$# | |
$$ 現在のプロセス ID | |
$% | |
$& 正規表現にマッチした箇所の文字列 | |
$' 正規表現にマッチした箇所より後ろの文字列 | |
$( | |
$) | |
$* Ruby スクリプトに指定された引数。ARGV と同じ |
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled. | |
Using the code from twitter bootstrap documentation page, this code is customized for table header. | |
Create the table with following layout - | |
<table class="table-fixed-header"> | |
<thead class="header"> | |
<tr> | |
<th>Column 1</th> | |
<th>Column 2</th> | |
<th>Column 3</th> |
module Sinatra | |
module Flash | |
module Style | |
def styled_flash(key=:flash) | |
return "" if flash(key).empty? | |
id = (key == :flash ? "flash" : "flash_#{key}") | |
close = '<a class="close" data-dismiss="alert" href="#">×</a>' | |
messages = flash(key).collect {|message| " <div class='alert alert-#{message[0]}'>#{close}\n #{message[1]}</div>\n"} | |
"<div id='#{id}'>\n" + messages.join + "</div>" | |
end |
0 00 0000000 | |
01011011111110 | |
010111111111000 | |
0111111111111110 | |
011111111111100 | |
01113113111111110 | |
0101310011111110 | |
00100031133100 |
# -*- encoding: utf-8 -*- | |
require 'benchmark' | |
class Character < Struct.new(:name, :level, :point) | |
def to_s | |
"%s:\tlv:%d\tpt:%d" % values | |
end | |
end | |