Skip to content

Instantly share code, notes, and snippets.

@RyoSugimoto
RyoSugimoto / wp_title.php
Last active December 11, 2015 01:59
WordPressでの<title>要素の記述例。
<title><?php
global $page, $paged;
// Import global variables about pages
wp_title('|', true, 'right');
// Get and display the title of the current page
bloginfo('name');
// Get the title of your blog
$site_description = get_bloginfo('description', 'display');
// Get the description, with quotes fixed
if ($site_description && (is_home() || is_front_page())){
@RyoSugimoto
RyoSugimoto / media_query.css
Created February 24, 2013 12:59
レティーナディスプレイのためのメディアクエリの記述例。
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
/* Styles */
}
@RyoSugimoto
RyoSugimoto / _auto_vender_prefixer_01.scss
Last active December 14, 2015 03:49
ベンダープリフィックスを自動で付与するSassミックスイン。
@mixin vendor-prefix($prop, $value) {
#{$prop}: $value;
-webkit-#{$prop}: $value;
-ms-#{$prop}: $value;
-moz-#{$prop}: $value;
-o-#{$prop}: $value;
}
@RyoSugimoto
RyoSugimoto / hide_text.css
Created February 24, 2013 13:19
テキストを隠す。
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
@RyoSugimoto
RyoSugimoto / opacity.css
Created February 24, 2013 13:26
IE6~8に対応した不透明度の設定。
.opacity {
opacity: .5;
filter: alpha(opacity=50);
-ms-filter: "alpha(opacity=50)";
}
@RyoSugimoto
RyoSugimoto / config.rb
Last active December 14, 2015 04:48
Compassの設定用ファイルの記述例。
http_path = "/"
sass_dir = "assets/sass"
css_dir = "assets/css"
javascripts_dir = "assets/js"
images_dir = "assets/img"
fonts_dir = "assets/fonts"
additional_import_paths = {}
disable_warnings = true
@RyoSugimoto
RyoSugimoto / _color_scheme.scss
Last active December 14, 2015 05:29
Sassのカラースキーム設定用ファイルの記述例。
/*
* Color Schemes Mixins
* Include this mixin on a selector,
* the colors are applied for its children.
* @mixin color-scheme-<name>
*/
// Default
@mixin color-scheme-default {
@RyoSugimoto
RyoSugimoto / Fetch.sublime-setting.json
Last active December 14, 2015 12:48
Sublime TextのFetchパッケージ用の設定ファイル。
{
"files":
{
"animate.css": "https://raw.github.com/daneden/animate.css/master/animate.min.css",
"backbone": "http://backbonejs.org/backbone-min.js",
"cssua.js": "https://bitbucket.org/mckamey/cssuseragent/raw/tip/cssua.min.js",
"d3": "http://d3js.org/d3.v3.min.js",
"es5-shim": "https://raw.github.com/kriskowal/es5-shim/master/es5-shim.min.js",
"flipsnap": "https://raw.github.com/pxgrid/js-flipsnap/master/flipsnap.min.js",
"head.js": "https://raw.github.com/headjs/headjs/v0.99/dist/head.min.js",
@RyoSugimoto
RyoSugimoto / preload_images.js
Last active December 14, 2015 14:59
指定した画像を読み込んでから、コールバック関数を実行する(画像の先読みを行なう)。
/**
* 指定した画像の読み込みがすべて終了してから
* コールバック関数を実行する。
* @param options.src {string/array} 画像のソースの文字列または配列
* @param options.complete {function} すべての画像の読み込みが完了するか失敗したときに、最後に実行する関数
* @param options.success {function} 読み込みが完了するたびに実行する関数
* @param options.error {function} 読み込みに失敗するたびに実行する関数
* @param options.cache {bool} 画像のキャッシュを利用するかどうか
*/
var preloadImages = function (options, i) {
@RyoSugimoto
RyoSugimoto / css_position_generator.jsf
Last active December 15, 2015 08:19
CSSの「top」と「left」プロパティを自動的に取得するFireWorksスクリプト。
/*
*
*/
(function (fw) {
if (!fw.selection || fw.selection.length == 0) {
alert('Run it again after selection of targets.');
return false;
}