Skip to content

Instantly share code, notes, and snippets.

@hbsnow
hbsnow / gist:5624277
Created May 22, 2013 00:00
WordPressでつづきを読むの内容をajaxで取得する
$(".more-link").click(function() {
var $this = $(this);
var $more = $this.parents(".entry-more");
var $content = $more.parents(".entry-content");
var file = $this.attr("href").replace("/#more", "/");
$more.remove();
$content.after("<div class='entry-content-more'><p class='more-loading'><span>now loading...</span></p></div>");
var $more_content = $content.next();
@hbsnow
hbsnow / jekyll_ver.rb
Last active December 21, 2015 08:28
jekyll で jekyll と compass のバージョンを取得する plugin
# 使用している jekyll, compass のバージョンを取得する plugin
# {% varsion markup %}
# @markup jekyll, compass
require 'rubygems'
require 'compass'
module Jekyll
class VersionTag < Liquid::Tag
def initialize(tag_name, markup, tokens)
@hbsnow
hbsnow / date.rb
Created August 21, 2013 09:06
Liquid で出力される Jekyll 用の日付のフォーマット用フィルタの plugin
# Liquid filter
# format_date 2013年01月01日
# w3cdtf_date 2013-01-01
module Jekyll
module AssetFilter
def format_date(date)
"#{date.strftime('%Y年%m月%d日')}"
end
"---------------
" Neobundle
"----------------
set nocompatible
filetype off
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim
call neobundle#rc(expand('~/.vim/bundle/'))
endif
@hbsnow
hbsnow / AssignedRolesSeeder.php
Last active August 29, 2015 14:06
Entrust 用のサンプル用 Seeder
<?php
class AssignedRolesSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
@hbsnow
hbsnow / gist:c4f9f751d37280a6471e
Last active August 29, 2015 14:11
インストールされているIEのバージョンを取得する
private int GetIEVersion()
{
var r = new Regex(@"(\d{1,2})\.(\d{1,2})\.[\d]+.[\d]+");
var m = r.Match(Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Internet Explorer").GetValue("Version").ToString());
var ver1 = Convert.ToInt32(m.Groups[1].Value);
var ver2 = Convert.ToInt32(m.Groups[2].Value);
if (ver1 == 9 && ver2 > 9)
{
@hbsnow
hbsnow / gist:ecda9da7083e50abfc06
Created December 31, 2014 05:17
数値入力に必要なキー以外を無効化する
private void KeyPressNumberOnly(Object sender, KeyEventArgs e)
{
if ((e.Key < Key.D0 || e.Key > Key.D9) &&
(e.Key < Key.NumPad0 || e.Key > Key.NumPad9) &&
e.Key != Key.Back &&
e.Key != Key.Delete &&
e.Key != Key.Left &&
e.Key != Key.Right &&
e.Key != Key.Tab)
{
@hbsnow
hbsnow / layout.less
Created March 18, 2015 14:48
flexboxのためのLESS
.layout {
// display
&.horizontal,
&.horizontal-reverse,
&.vertical,
&.vertical-reverse {
display: flex;
}
&.inline {
@hbsnow
hbsnow / github.less
Last active August 29, 2015 14:18
prism.jsのテーマ。
pre[prism] {
// color
@base00: #fff;
@base0: #333;
@base1: #969896;
@brown: #693a17;
@orange: #df5000;
@red: #b52a1d;
@magenta: #a71d5d;
@violet: #795da3;
@hbsnow
hbsnow / github.less
Created June 22, 2015 17:09
highlight.jsのテーマ。
pre.highlight {
// prefix
@base: hljs-;
@lang: language-;
// color
@base00: #fff;
@base0: #333;
@base1: #969896;
@brown: #693a17;