Skip to content

Instantly share code, notes, and snippets.

View kobaatsu's full-sized avatar

KOBAYASHI atsushi kobaatsu

View GitHub Profile
@kobaatsu
kobaatsu / pref.csv
Last active August 5, 2022 07:22
都道府県一覧 #utils
北海道 HOKKAIDO hokkaido
青森県 AOMORI aomori
岩手県 IWATE iwate
宮城県 MIYAGI miyagi
秋田県 AKITA akita
山形県 YAMAGATA yamagata
福島県 FUKUSHIMA fukushima
茨城県 IBARAKI ibaraki
栃木県 TOCHIGI tochigi
群馬県 GUNMA gunma
@kobaatsu
kobaatsu / WordPress用OGP生成.pug
Last active March 22, 2018 02:18
[OGP for Wordpress] 色々改変の余地あり #wordpress
| <?php
| $name_site = get_bloginfo('name');
| $url_parsed = parse_url(get_bloginfo('url'));
| $domain_site = $url_parsed['host'];
| $url_template = get_bloginfo('template_url');
| $title_page = '';
| if(!is_front_page()){
//- 前に謎のスペースが入るのでtrimする
@kobaatsu
kobaatsu / yohbi.json
Last active November 9, 2022 09:17
曜日の配列 #utils
[
{"day":"sun","yohbi":"日"},
{"day":"mon","yohbi":"月"},
{"day":"tue","yohbi":"火"},
{"day":"wed","yohbi":"水"},
{"day":"thu","yohbi":"木"},
{"day":"fri","yohbi":"金"},
{"day":"sat","yohbi":"土"}
];
@kobaatsu
kobaatsu / stroke.styl
Last active April 20, 2018 03:27
[文字の縁取り]
text-stroke(hoff = 1px, voff = 1px, blur = 0, color = #000)
text-shadow (-1 * hoff) (-1 * voff) blur color, hoff (-1 * voff) blur color, (-1 * hoff) voff blur color, hoff voff blur color
@kobaatsu
kobaatsu / vertical-ribbon.styl
Last active August 5, 2022 06:54
[縦リボン] #stylus
// あまり見なかったので作った後で整理する
.ribbon-vertical
w = 46px
size = 3px
position absolute
top t = (-(size px))
left 10px
overflow hidden
width: (w + size) px
height h = 29px
@kobaatsu
kobaatsu / jqueryCDN.pug
Last active March 22, 2018 02:16
[jqueryCDN] #CDN
script(src="//ajax.googleapis.com/ajax/libs/jquery/x.x.x/jquery.min.js")
script
| window.jQuery || document.write('<script src="
// path.script = ...
= path.script
| /jquery.min.js"><\/script>');
@kobaatsu
kobaatsu / balloon.styl
Last active April 20, 2018 03:25
[フキダシ] 暫定版
balloon(position, size, color)
position relative
border 1px solid color
background-color #FFF
border-radius 5px
&::before
&::after
content ""
position absolute
width 0
@kobaatsu
kobaatsu / ellipsed_title.php
Last active March 22, 2018 02:49
[タイトルを以下略] #wordpress
function get_abbreviated_title($post_id, $num_char = 20, $ellips = '&hellip;') {
$title = get_the_title($post_id);
if ( mb_strlen($title, 'UTF-8') > $num_char ) {
$title = mb_substr($title, 0, $num_char, 'UTF-8') . $ellips;
}
return $title;
}
@kobaatsu
kobaatsu / sort.pug
Last active March 22, 2018 02:52
[objectをソートしてイテレーション]
- var menu = [{order:20, label:'foo'},{order:10, label:'bar'}]
- menu.sort((a,b)=>{return a.order > b.order ? 1 : -1})
each m in menu
li= m.label
@kobaatsu
kobaatsu / sns-color.styl
Last active August 22, 2018 02:39
[SNSカラー] #SNS
color-twitter = #55acee
color-facebook = #3B5998
color-googleplus = #C64B3F
color-line = #00C200