Skip to content

Instantly share code, notes, and snippets.

@hideki-a
hideki-a / slide_autoprefixer.md
Last active January 19, 2016 01:21
Autoprefixerの紹介

Autoprefixerの紹介


CSS3を記述する時、ベンダープリフィックスはどうしていますか?

  • 1つ1つ手で記述している
  • Emmetで展開した時、自動で出力されるのを利用している
.test{
    -webkit-box-shadow: ;
    -moz-box-shadow: ;
(function ($) {
if (SDJL.mobile.smartphone) {
$(function () {
$("body").prepend("<p class='mod-changeview'><a href='/sp/'>スマートフォンサイトを閲覧</a></p>");
});
}
}(jQuery));
@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