Skip to content

Instantly share code, notes, and snippets.

View webbingstudio's full-sized avatar
🤤
Working from home

うぇびんさん webbingstudio

🤤
Working from home
View GitHub Profile
@webbingstudio
webbingstudio / box-spacing.scss
Last active October 30, 2016 11:16
ボックスの文字サイズと行間を反映した上下余白をremで返すmixin ref: http://qiita.com/webbingstudio@github/items/b607869bedec12eea961
// px高さと文字サイズから必要な余白を計算し、remで返す
@mixin box-spacing( $height: 30, $font-size: 16, $line-height: 1.35, $border-top: 0, $border-bottom: 0, $rem: 16 ) {
padding-top: ( ( ( $height - ( $border-top + $border-bottom ) - ( $font-size * $line-height ) ) / 2 ) / $rem ) * 1rem;
padding-bottom: ( ( ( $height - ( $border-top + $border-bottom ) - ( $font-size * $line-height ) ) / 2 ) / $rem ) * 1rem;
}
@webbingstudio
webbingstudio / file0.css
Last active October 30, 2016 10:49
CMSで見出しへの自動装飾とclassによる手動装飾を共存させる ref: http://qiita.com/webbingstudio@github/items/71b81657bfaddd4321d8
h1 {
/* h1の装飾 */
}
h2 {
/* h2の装飾 */
}
@webbingstudio
webbingstudio / iso8601date.js
Last active October 13, 2016 04:22
iso8601をDateオブジェクトに変換する ref: http://qiita.com/webbingstudio@github/items/74ff85bdac03f1a9aec7
var iso8601Date = function(iso) {
var parse = iso.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\+\d{2}:\d{2}/);
return new Date( Number(parse[1]), Number(parse[2]), Number(parse[3]), Number(parse[4]), Number(parse[5]), Number(parse[6]) );
};
...
var pubdate = iso8601Date( '2016-10-12T17:47:15+09:00' );
console.log(pubdate[1]); //2016
@webbingstudio
webbingstudio / blog-color.html
Created October 11, 2016 08:27
a-blog cmsで管理ページの削除ボタンを無効化する ref: http://qiita.com/webbingstudio@github/items/82eff458df1bcba17746
<!-- BEGIN_IF [%{BID}/eq/1] -->
<style>
/* 管理ページ内でサイトの根幹に関わる設定の削除を禁止する */
.acms-admin-form input[name^="ACMS_"][name*="Blog_Delete:"],
.acms-admin-form input[name^="ACMS_"][name*="Category_Delete:"] {
position: relative;
background: #ccc none;
color: #333;
border-color: #999;
opacity: .5;
@webbingstudio
webbingstudio / acms_user_login_anywhere_subscriber.sql
Created August 25, 2016 11:42
a-blog cmsのユーザーで「読者」権限を持つユーザーを「どこでもログイン」状態にする
UPDATE `acms_user` SET `user_login_anywhere`='on' WHERE `user_auth` = 'subscriber'
@webbingstudio
webbingstudio / acms_delete_subscriber.sql
Created August 25, 2016 11:39
a-blog cmsのユーザーで「読者」権限を持つユーザーを一括削除する
DELETE FROM `acms_user` WHERE `user_auth` = 'subscriber'
@webbingstudio
webbingstudio / safari_no_svg.js
Created July 21, 2016 06:05
modernizrでの判定もできないSnowLeopardのSafari5に対し、SVGsupport有無の判定を行う
(function($){
$(function(){
var userAgent = window.navigator.userAgent.toLowerCase();
if (userAgent.indexOf('safari') != -1) {
var version = userAgent.match(/^.*\sversion\/(\d+)\.\d.*$/);
if ( parseInt( version[1] ) < 9 ){
console.log('no SVG');
} else {
console.log('support SVG');
@webbingstudio
webbingstudio / acms_admin_entry_unit_extend_button.html
Last active May 11, 2016 17:27
a-blog cmsのカスタムユニット:ボタン
<!-- BEGIN custom_button -->
<table class="entryFormColumnSettingTable entryFormColumnTable">
<tr>
<td class="entryFormFileControl">
<table class="entryFormColumnSettingTable">
<tr>
<th style="white-space: nowrap;">ボタンの文字列</th>
<td>
<input type="text" name="button_text{id}" value="{button_text}" class="acms-admin-form-width-half" />
@webbingstudio
webbingstudio / acms_admin_entry_unit_extend_file.html
Last active May 9, 2016 16:06
a-blog cmsのカスタムユニット:ファイル
<style>
.acms-admin-ex-notice {
margin: 5px 0;
padding: 5px;
background-color: #F9F9F9;
color: #339900;
font-size: .75rem;
line-height: 1.25;
}
</style>
@webbingstudio
webbingstudio / acms_admin_entry_unit_extend_select.html
Last active May 9, 2016 15:55
a-blog cmsのカスタムユニット:セレクトボックス
<style>
.acms-admin-ex-notice {
margin: 5px 0;
padding: 5px;
background-color: #F9F9F9;
color: #339900;
font-size: .75rem;
line-height: 1.25;
}
</style>