Skip to content

Instantly share code, notes, and snippets.

@hideki-a
hideki-a / nginx
Created February 20, 2014 12:27
MTのタグ検索ページを/tag/(タグ)/page/(ページ数)/のようなパスで表示する
server {
server_name www.anothersky.pw;
# 掲載省略
rewrite ^/tag/(.*?)/?(page/([0-9]+)/?)?$ /mt/mt-search.cgi?tag=$1&IncludeBlogs=1,2&page=$3 last;
# 掲載省略
}
# http://editorconfig.org
root = true
[*]
indent_style = tab
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@hideki-a
hideki-a / screen_capture.coffee
Last active August 29, 2015 13:59
コマンド(例:`casperjs ./screen_capture.coffee ./urls.json`)を実行すると、urls.jsonに記載のURLを指定の画面幅でキャプチャする。画像はPNG形式で、ディレクトリ構造を維持して保存する。urls.jsonは、Excelで作成してJSONに変換すると簡単。
# screen_capture.coffee
# v1.0.2
# 2014.4.11 Hideki Abe
# Reference site: http://net.tutsplus.com/tutorials/javascript-ajax/responsive-screenshots-with-casper/
# Viewport width size setting
viewportSizes = [320,600,1024]
saveDirRoot = ""
@hideki-a
hideki-a / Gruntfile.coffee
Created July 7, 2014 02:29
BrowserSyncに置き換えたバージョン
'use strict'
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
sass:
options:
sourcemap: true
compass: true
@hideki-a
hideki-a / SassMeister-input.scss
Created July 15, 2014 03:40
Generated by SassMeister.com.
// ----
// Sass (v3.4.0.rc.1)
// Compass (v1.0.0.alpha.20)
// ----
// Using "&" in SassScript
.list-products{
overflow: hidden;
margin-right: -30px;
li{
@hideki-a
hideki-a / SassMeister-input.scss
Created July 16, 2014 01:30
Generated by SassMeister.com.
// ----
// Sass (v3.4.0.rc.1)
// Compass (v1.0.0.alpha.20)
// ----
// Reference: https://www.youtube.com/watch?v=o4ok4gsiQSw
@mixin insert-context($target, $add-contexts...) {
$new-contexts: ();
$new-selector: ();
# Path Settings
basepath = '../htdocs/'
paths =
styles:
src: basepath + '_scss/'
dest: basepath + 'css/'
images:
src: basepath + '**/*.{png,jpg,svg}'
# Read Modules
# grunt-newer:
# Check for newer @import .scss files example(CoffeeScript version)
# Customized of @bellerus https://gist.github.com/bellerus/10414499
# See: https://github.com/tschaub/grunt-newer/issues/29
module.exports.checkForModifiedImports = (details, action) ->
fs = require('fs')
path = require('path')
scssFile = details.path
mTime = details.time
@hideki-a
hideki-a / eccube_change_extract_payment_method.patch
Last active August 29, 2015 14:07
EC-CUBEで、選択可能な支払い方法の抽出時に送料が勘案されないため、代引手数料等が狂う問題の解決。EC-CUBE 2.13.2。
diff --git a/eccube_data/class/pages/shopping/LC_Page_Shopping_Payment.php b/eccube_data/class/pages/shopping/LC_Page_Shopping_Payment.php
index 0cc5ee5..2bfef7f 100644
--- a/eccube_data/class/pages/shopping/LC_Page_Shopping_Payment.php
+++ b/eccube_data/class/pages/shopping/LC_Page_Shopping_Payment.php
@@ -125,6 +125,11 @@ class LC_Page_Shopping_Payment extends LC_Page_Ex
// お届け日一覧の取得
$this->arrDelivDate = $objPurchase->getDelivDate($objCartSess, $cart_key);
+ // 配達先の都道府県IDの取得
+ // 本サイトでは単一の配送先しか認めていないので、複数のお届け先については未検証
@hideki-a
hideki-a / japanese_syllabary.scss
Created January 22, 2015 12:17
50音を並べたボタン
.list-syllabary-ja{
$item-font-size: 16px;
$item-margin: 10px;
$item-border-width: 1px;
$item-padding: 5px;
display: -webkit-flex;
display: flex; // See Also: http://www.w3.org/TR/css3-flexbox/
-webkit-flex-flow: row wrap;
-ms-flex-flow: row wrap;