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
[*0..10].reverse.each{|i| puts i} | |
10.step(0, -1){|i| puts i} | |
(-10..0).each{|i| i *= -1; puts i} | |
r = (10..0) | |
(r.first).downto(r.last).each{|i| puts i} |
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 | |
AE | |
AED | |
AF | |
AFN | |
AL | |
ALL | |
AM | |
AMD | |
AN |
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
#!/bin/sh | |
if [ ! -d "$1" -o ! -f "$1/Gemfile" ]; then | |
echo Usage `basename $0` /path/to/app [command... ] | |
exit 1 | |
fi | |
PATH=$HOME/.rvm/bin:$PATH | |
APP_DIR=$(cd $1 && pwd) | |
APP_NAME=`basename $APP_DIR` |
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
# -*- coding: utf-8 -*- | |
# referred to | |
# http://thesteve.org/technoblarg/2011/10/01/square-thumbnails-with-minimagick/ | |
require 'mini_magick' | |
module MiniMagick | |
class Image | |
def self.square(src, dst, size) | |
thumb = open src | |
thumb.square dst, size |
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
#!/bin/bash | |
# | |
# referred to | |
# http://www.stopdropandrew.com/2010/06/01/where-unicorns-go-to-die-watching-unicorn-workers-with-monit.html | |
# | |
if test -z "$RACK_ENV"; then | |
RACK_ENV=production | |
fi | |
if test -f ~/.rvm/scripts/rvm -o "$(type -t rvm)" = "function"; then | |
source ~/.rvm/scripts/rvm |
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
# -*- coding: utf-8 -*- | |
require 'jekyll' | |
require 'flickraw' | |
require 'fileutils' | |
module Jekyll | |
class GeneratePhotosets < Generator | |
safe true | |
priority :low |
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
--- | |
title: 第5話 死体置き場にもう一人 | |
layout: layout | |
photoset: XXXXXXXXXXXXXXXXX | |
--- |
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
{% if page.photoset %} | |
<div class="gallery"> | |
{% for photo in page.photos %} | |
<a href="{{ photo.medium_source }}"> | |
<img src="{{ photo.square_source }}" width="{{ photo.square_width }}" height="{{ photo.square_height }}" /> | |
</a> | |
{% endfor %} | |
</div> | |
{% endif %} |
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
$ gem install flickraw | |
$ cd /path/to/jekyll | |
$ ruby _plugins/flickr.rb |
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
flickr: | |
enabled: true | |
api_key: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
shared_secret: "xxxxxxxxxxxxxxxx" | |
auth_token: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" | |
secret: "xxxxxxxxxxxxxxxx" | |
cache_dir: /tmp/jekyll/flickr |
OlderNewer