Skip to content

Instantly share code, notes, and snippets.

@onjiro
onjiro / calibrecron.sh
Created February 28, 2012 04:00
Calibre のあれ
#/bin/bash
PATH_RECIPES=(calibreインストールディレクトリ)/calibre/resources/recipes
PATH_EBOOKS_OUT=(ebook出力先ディレクトリ)
# 実行前に出力先ディレクトリをクリーン
rm $PATH_EBOOKS_OUT/*
# ebook生成
xvfb-run ebook-convert $PATH_RECIPES/reuters_ja.recipe $PATH_EBOOKS_OUT/reuters_ja.mobi --output-profile kindle --tags "Reuters(Japan),ニュース"
/* applying basic page frame, 2 column-format, background and spacing */
html {
background-image: url(img/background.jpg);
background-repeat: repeat; }
body {
font-family: sans-serif;
color: #4b4b4b;
width: 980px;
margin: 20px auto;
icon-width = 20px
legger-width = 80px
li
// 通常時はアイコンだけ表示
white-space nowrap
width icon-width
color rgba(128, 128, 192, 0.0)
// カーソルを話したときもうにょーっと狭まる
transition width 1.2s ease
@onjiro
onjiro / style.css
Created February 23, 2012 08:50
遊んでみた
body {
background: none repeat scroll 0 0 #333344;
font-family: Osaka,Helvetica Neue,Helvetica,Arial;
font-size: 14px;
text-align: center;
}
h1 {
color: #FFFFFF;
font-size: 70px;
padding: 30px 0 0;
@onjiro
onjiro / standardPattern.styl
Created February 23, 2012 02:10
css でよく使うパターン on stylus
@charset "utf-8"
// :before, :after を使用して要素を追加する場合によく使うパターン
blockForPseudo(position, width, height)
content ""
display block
position position
width width
height height
@onjiro
onjiro / installgit.sh
Created February 21, 2012 12:12
git initialize
#!/bin/sh
sudo apt-get install git
alias g=git
echo "alias g=git" >> ~/.bashrc
g config --global user.name onjiro
g config --global user.password [email protected]
g config --global alias.co checkout
g config --global alias.br branch
@onjiro
onjiro / nvminstall.sh
Created February 21, 2012 11:55
nvm install
#!/bin/sh
sudo apt-get install curl
git clone git://github.com/creationix/nvm.git ~/.nvm
. ~/.nvm/nvm.sh
echo ". ~/.nvm/nvm.sh" >> ~/.bashrc
echo "enter node version you want to install..."
read -p "ex.) v0.6.11 > " version
@onjiro
onjiro / baloonsample.html
Created February 10, 2012 07:42
吹き出しアニメーション
<html>
<head>
<style type="text/css">
/* アイコンは次のサイトのとか使わせてもらったらそれっぽいかも */
/* http://hail2u.net/blog/webdesign/shirokuro-social-icons-v1.5.html */
body {
z-index: 0;
margin-left: 80px;
margin-top: 80px;
background-color: #aaa;
@onjiro
onjiro / grep_replace.sh
Created February 7, 2012 05:45
grep して 置換するよー。sed -i が使えればこんな面倒なことはいらないッ・・・!
# 次の置換と同じ。
# grep -lre h1 検索対象ディレクトリ | xargs sed -i 's/h1/h2/g'
grep -lre 'h1' 検索対象ディレクトリ | xargs -n 1 -i sh "cp {} tmp; sed -e 's/h1/h2/g' ./tmp > {}"
@onjiro
onjiro / 画面いっぱいを2画面.html
Created January 17, 2012 04:00
画面いっぱいを2画面に表示するサンプル
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
<!--
* {
margin: 0;
padding: 0;
}
html, body {