Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryuichi.N nukos

  • Tokyo/Japan
View GitHub Profile
@nukos
nukos / tree_install
Created Aug 25, 2014
use tree command
View tree_install
$ brew install tree
@nukos
nukos / amazon.rb
Last active Aug 29, 2015 — forked from upvalue/amazon.rb
JP Amazon Associate
View amazon.rb
# amazon.rb - amazon affiliate links for jekyll
# assumes that you have a configuration variable called 'amazon_associate_id' with your associate id
# usage: {{ asin | amazon_product_href }}
# returns url of a product
# usage: {{ asin | amazon_image_href: 'M' }}
# returns image of the product, size argument can be S, M, or L, default M
# usage: {{ asin | amazon_product: 'A Product' }}
@nukos
nukos / post.yml
Created Sep 8, 2014
Jekyll Blog Yaml FrontMatter
View post.yml
---
published: [true | false]
layout: post
date: Y-m-d HH:MM
title: [text]
series: [text]
description: [text]
categories: [text, text...]
tag:
- [text]
@nukos
nukos / httpd.conf
Last active Aug 29, 2015
Wordpress Apache Setting
View httpd.conf
ServerTokens ProductOnly
SercerRoot "/etc/httpd"
Timeout 60
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 10
Listen 80
#load modules
@nukos
nukos / _colors.scss
Last active Aug 29, 2015
SCSS color palette mixin.
View _colors.scss
$palettes: (
'typo': (
'base': (
'normal': #E6ECF2,
'light' : #ffffff,
'dark' : #dddddd
),
'inverse': (
'normal': #444444,
@nukos
nukos / add_date_for_csv.sh
Last active Aug 29, 2015
CSVの行に一括で日付を追加する
View add_date_for_csv.sh
# すべての行の先頭に日付を追加
LC_ALL=C sed -i -e 's/^/2014\/12\/08,/g' 2014-12-08.csv
# 先頭行の項目名を日付に修正する
LC_ALL=C sed -i -e '1s/^2014\/12\/08/日付/g' 2014-12-08.csv
# 月ごとにCSVを結合する
cat 2014-12-*.csv > 2014-12.csv
# すべてのCSVを結合する
@nukos
nukos / tag_order.rb
Last active Aug 29, 2015
Sort the tag of jekyll in Posts.
View tag_order.rb
module Jekyll
module Filters
def tag_order(tags, order, orderby='ASC')
# order
case order
when 'count' then
order_tags = tags.sort_by { | t, posts | posts.count }
end
View example.html
<h1>Embed Example</h1>
<p>hoge</p>
@nukos
nukos / _color_palettes.scss
Last active Aug 29, 2015
SCSS Color Management Mixins.
View _color_palettes.scss
// Mixin to return the color code
//
// $palettes - Array containing the palette.
// $palette_name - The name of the palette.
// $property_name - The name of the property.
// $tone_name - (option) The name of the tone.
// $state_name - (option) The name of the state of tone.
//
@function palette( $palettes, $palette_name, $property_name, $state_name: 'normal', $tone_name: 'base' ){
$error_color : #cc0000;
@nukos
nukos / _color_palettes_mixins.scss
Created Mar 6, 2015
SCSS Color Code Managemant Mixins.
View _color_palettes_mixins.scss
// Mixin to return the color code
//
// $property_name - The name of the property.
// $args - Argments.
// - name : Component name.
// - palettes : Palettes Array (Default: $PALETTES).
// - state : <Option> State Name (Default: normal).
// - theme : <Option> Theme Name (Default: base).
//
// EXAMPLE: