Skip to content

Instantly share code, notes, and snippets.

$ brew install libxml2 libxslt
$ brew link libxml2 libxslt --force
$ wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
$ tar xvfz libiconv-1.13.1.tar.gz
$ cd libiconv-1.13.1
$ ./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
$ make
$ sudo make install
$ gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.7.8/include/libxml2
function countCSSRules() {
var results = '',
log = '';
if (!document.styleSheets) {
return;
}
for (var i = 0; i < document.styleSheets.length; i++) {
countSheet(document.styleSheets[i]);
}
function countSheet(sheet) {
@machida
machida / application.html.erb
Last active August 29, 2015 13:56
jobweb講座
<!DOCTYPE html>
<html>
<head>
<title>Bookshelf</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
<header class="header">
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>美味しいカレーのレシピ</title>
<meta name="description" content="誰でもできる、美味しいカレーの作り方です。">
</head>
<body>
<h1>カレーのレシピ</h1>
@machida
machida / _rgba.css.sass
Created January 28, 2014 08:31
rgbaをIE8に対応させるためのmixin
=rgba($foreground, $backdrop: white, $property: "background-color")
#{$property}: mix(fade-in($foreground, 1), $backdrop, percentage(opacity($foreground)))
// Browsers without color opacity
#{$property}: $foreground
// Decent browsers
@if $property == "background-color"
.lt-ie9 &
// IE8 has background filters; use them instead
#{$property}: transparent
$ie-hex: ie-hex-str($foreground)
@machida
machida / application.html.erb
Created January 26, 2014 13:56
Schoo用 元マークアップ
<!DOCTYPE html>
<html>
<head>
<title>Bookshelf</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
@machida
machida / index.html.erb
Created January 26, 2014 12:49
schoo用 元マークアップ
<h1>書籍一覧</h1>
<table>
<thead>
<tr>
<th>Title</th>
<th>Price</th>
<th></th>
<th></th>
<th></th>
@machida
machida / index.html.erb
Last active January 4, 2016 11:09
schoo用
<h1>書籍一覧</h1>
<div class="books">
<% @books.each do |book| %>
<div class="book">
<h2 class="book__title"><%= book.title %></h2>
<p class="book__price">¥ <%= book.price %></p>
<ul class="book__actions">
<li class="book__action--show"><%= link_to '詳細', book %></li>
<li class="book__action--edit"><%= link_to '編集', edit_book_path(book) %></li>
@machida
machida / books.css.scss
Last active January 4, 2016 11:09
schoo用
// これを全部
// app/assets/stylesheets/books.css.scss に
// コピー & 貼り付けする
// 色の設定
$bgColor: #dfcf8f;
$baseColor: #dff1f8;
$textBlack: #444444;
$textWhite: #ffffff;
@machida
machida / index-customized.html.erb
Last active January 3, 2016 16:39
rails scaffold で生成された app/views/books の中の erbファイル
<h1>書籍一覧</h1>
<ul class="books">
<% @books.each do |book| %>
<li class="book">
<h2 class="book__title"><%= book.title %></h2>
<p class="book__price">
<span class="book__price-label">価格</span>
<%= book.price %>
</p>