Skip to content

Instantly share code, notes, and snippets.

@sou-lab
sou-lab / SassMeister-input.scss
Created October 12, 2016 06:02
Generated by SassMeister.com.
// ----
// libsass (v3.3.6)
// ----
$z-index:(
// ↑レイヤー上
child,
pulldown,
nav,
header
@sou-lab
sou-lab / reverse.scss
Created September 19, 2016 10:23
reverse a list
//配列をリバース
@function reverse($list) {
$result: ();
@for $i from length($list)*-1 through -1 {
$result: append($result, nth($list, abs($i)), comma);
}
@return $result;
}
@sou-lab
sou-lab / functions.php
Created July 28, 2016 19:18
キャプションショートコードのfigureにaria-labelledbyを、figcaptionにそのidを付ける
<?php
//キャプションにaria-labelledbyを付ける
add_shortcode('caption', 'my_img_caption_shortcode');
function my_img_caption_shortcode( $attr, $content = null ) {
// New-style shortcode with the caption inside the shortcode with the link and image tags.
if ( ! isset( $attr['caption'] ) ) {
if ( preg_match( '#((?:<a [^>]+>\s*)?<img [^>]+>(?:\s*</a>)?)(.*)#is', $content, $matches ) ) {
$content = $matches[1];
$attr['caption'] = trim( $matches[2] );
@sou-lab
sou-lab / functions.php
Last active June 17, 2016 13:49 — forked from mypacecreator/functions.php
WP SitemanagerまたはPrime Strategy Bread Crumbの拡張(type string対応版)
<?php
//パンくずのリッチスニペット対応
function rich_bread_crumb($output, $args) {
if ($args['type'] == 'list') {
$output = preg_replace('|<li\s+(.*?)>|mi','<li ${1} itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb">',$output);
$output = preg_replace('|<li\s+class="(.*?current.*?)".*?>|mi','<li class="${1}">',$output);
$output = preg_replace('|<a\s+(.*?)>|mi','<a ${1} itemprop="url"><span itemprop="title">',$output);
$output = str_replace('</a>','</span></a>',$output);
} elseif ($args['type'] == 'string') {
$output = preg_replace('|<a\s+(.*?)>|mi','<span itemscope="itemscope" itemtype="http://data-vocabulary.org/Breadcrumb"><a ${1} itemprop="url"><span itemprop=”title”>',$output);
@sou-lab
sou-lab / wp.fish
Created March 25, 2016 16:59
wp-cli fish completion
# wp-cli
complete -c wp -l cache --description 'Manage the object cache.'
complete -c wp -l cap --description 'Manage user capabilities.'
complete -c wp -l cli --description 'Get information about WP-CLI itself.'
complete -c wp -l comment --description 'Manage comments.'
complete -c wp -l core --description 'Download, install, update and otherwise manage WordPress proper.'
complete -c wp -l cron --description 'Manage WP-Cron events and schedules.'
complete -c wp -l db --description 'Perform basic database operations.'
complete -c wp -l eval --description 'Execute arbitrary PHP code.'
complete -c wp -l eval-file --description 'Load and execute a PHP file.'
@sou-lab
sou-lab / SassMeister-input.scss
Created January 21, 2016 04:08
Generated by SassMeister.com.
// ----
// Sass (v3.4.20)
// Compass (v1.0.3)
// ----
.wrap {
@media (min-width: 769px) {
display: block;
@at-root (without: media){
.box {
プロパティー 発音
background-attachment バックグラウンド・アタッチメント
background-color バックグラウンド・カラー
background-image バックグラウンド・イメージ
background-position バックグラウンド・ポジション
background-repeat バックグラウンド・リピート
background バックグラウンド
border-collapse ボーダー・コラプス
border-color ボーダー・カラー
@sou-lab
sou-lab / jQuery-Plugin-Format.coffee
Last active August 29, 2015 14:17
jQuery Plug-in Format (coffee)
do ($=jQuery) ->
namespace = 'pluginName'
$.fn[namespace] = (options) ->
if @length == 0
return false
settings = $.extend(
# settings default
foo: 'fuga'
bar: 'hoge'
@sou-lab
sou-lab / Emmet.sublime-settings
Last active August 29, 2015 14:17
Emmet.sublime-settings
{
//お約束
"snippets": {
"variables": {
"lang": "ja",
"locale": "ja-JP"
}
},
// 補完のスコープ対象にSassファイルを追加
@sou-lab
sou-lab / sass.fish
Created February 27, 2015 16:33
fish shell completions sass.fish
#sass
complete -f -c sass -s c -l check --description ""
complete -f -c sass -s C -l no-cache --description ""
complete -f -c sass -s g -l debug-info --description ""
complete -f -c sass -s h -l help --description ""
complete -f -c sass -s i -l interactive --description ""
complete -f -c sass -s l -l line-comments -l line-numbers --description ""
complete -f -c sass -s s -l stdin --description ""
complete -f -c sass -s t -l style --description ""
complete -f -c sass -s v -l version --description ""