open images (latest 10)
at the index page(you must log in)
javascript:var%20img%20=%20document.querySelectorAll(%22main%20article%20div%20img%22);for%20(var%20i%20=%200;%20i%20<%2010;%20i++)%20{window.open(img[i].src);}
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<body> | |
<script src="http://d3js.org/d3.v2.min.js?2.10.0"></script> | |
<script> | |
var width = 960, | |
height = 700; | |
var svg = d3.select("body").append("svg") |
module ActiveModelSerializers | |
class Model | |
def update(attrs = {}) | |
attrs.each do |k, v| | |
instance_variable_set("@#{k}", v) unless (k.nil? && v.nil?) | |
end | |
self | |
end | |
end |
module ActiveRecord | |
module Aggregations | |
module ClassMethods | |
private | |
def reader_method(name, class_name, mapping, allow_nil, constructor) | |
define_method(name) do | |
if @aggregation_cache[name].nil? && (!allow_nil || mapping.any? { |key, _| !_read_attribute(key).nil? }) | |
attrs = mapping.collect { |key, val| [val, _read_attribute(key)] } |
require 'test/unit' | |
class ReportFormat | |
file = ARGV[0] | |
raise ArgumentError, 'wrong number of arguments (expected 1)' if file.nil? | |
@@text = File.read(file).gsub!(/%.*$/,"")#s.split("\n") | |
# p @@text | |
def self.get_labels | |
@@text.scan(/label[={]([^,\}\]]*)/).flatten.sort.uniq | |
end |
#!/bin/sh | |
file="index.html" | |
fontsize="14" | |
ptlist="$(cat $file | grep "pt" | sed -e 's/pt/@\n/g' -e 's/\s/\n/g' \| | |
cut -d":" -f2 | grep '@' | tr -d '@' | tr -d ' ' | sort | uniq)" | |
for pt in $ptlist; do | |
em="$(echo "scale=4; $pt * 4 / 3 / $fontsize" | bc)" | |
echo "$pt => $em" |
require 'date' | |
require 'sinatra' | |
require 'holiday_jp' | |
set :environment, :production | |
module HolidayJp | |
def self.next_holiday(day) | |
HOLIDAYS.find do |date, holiday| | |
day < date |
#!/bin/bash | |
# | |
# picnic - deploy git without sudo/root | |
# | |
INSTALL_DIR=${INSTALL_DIR:-"$HOME/picnic-tools"} | |
WORK_SPACE=${WORK_SPACE:-"/tmp/picnic"} | |
LOGFILE="$WORK_SPACE/install.log" | |
function warn { |
#/bin/env bash | |
# git remote repo ssh/http switcher | |
function warn { | |
# color:yellow | |
echo -e "\033[33mWarning:\033[m" "$*" | |
} | |
function error { | |
# color:red |
#! /bin/bash | |
# =UPDATE HISTRY= | |
# 9 July, 2015 : New | |
# 12 July, 2015 : fix Makefile Form | |
function usage { | |
echo "" | |
echo 'The Report Environment Initialize Script' | |
echo 'Usage : [./Program name <Directory name>]' |