Skip to content

Instantly share code, notes, and snippets.

View geckotang's full-sized avatar
:octocat:

Shotaro Sakamaki geckotang

:octocat:
View GitHub Profile
@geckotang
geckotang / memo.md
Created October 21, 2013 15:25
hubコマンドですでにあるissueに紐付けたpull-requestする
//@param items {Array} ランダムに抽出する対象の配列
//@param pickoutNum {Number} 抽出する個数
//@see http://d.hatena.ne.jp/miya2000/20080607/p0
function random(items, pickoutNum) {
var tmp = {};
var result = [];
var itemNum = items.length;
pickoutNum = (pickoutNum < itemNum) ? pickoutNum : itemNum;
while (pickoutNum-- > 0) {
var i = Math.random() * itemNum | 0;
<!DOCTYPE html>
<html class="ua_js_no ua_css_standard">
<head>
<meta charset="utf-8"/>
<title>Title of the page</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<script>;(function(d,e,c,r){e=d.documentElement;c="className";r="replace";e[c]=e[c][r](/(ua_js_)no/g,"$1yes");if(d.compatMode!="CSS1Compat")e[c]=e[c][r](/(ua_css_)standart/g,"$1quirks")})(document);</script>
<!--[if gt IE 9]><!--><link rel="stylesheet" href="index/_index.css"/><!--<![endif]-->
<!--[if gte IE 6]><link rel="stylesheet" href="index/_index.ie.css"/><![endif]-->
<meta name="description" content=""/>
<!DOCTYPE html>
<html class="ua_js_no ua_css_standard">
<head><meta charset="utf-8"/>
<title>俺が考えた最強のタイトル</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<script>;(function(d,e,c,r){e=d.documentElement;c="className";r="replace";e[c]=e[c][r](/(ua_js_)no/g,"$1yes");if(d.compatMode!="CSS1Compat")e[c]=e[c][r](/(ua_css_)standart/g,"$1quirks")})(document);</script>
<!--[if gt IE 9]><!--><link rel="stylesheet" href="index/_index.css"/><!--<![endif]-->
<!--[if gte IE 6]><link rel="stylesheet" href="index/_index.ie.css"/><![endif]-->
<meta name="description" content="俺の考えた最強のBEM"/><link rel="shortcut icon" href="favicon.ico"/></head>
<body class="page page__body">
<img class="heroImage" src="http://placehold.jp/960x150.png" alt=" ">
<ul class="tab">
<li class="tab__item tab__item_is_current">tab1</li>
<li class="tab__item">tab2</li>
</ul>
var PATH = require('path'),
BEM = require('bem'),
environ = require('bem-environ');
exports.baseLevelPath = require.resolve('../../.bem/levels/bundles.js');
exports.getConfig = function() {
return BEM.util.extend(this.__base() || {}, {
bundleBuildLevels: this.resolvePaths([
({
block: 'page',
title: '俺が考えた最強のタイトル',
favicon: 'favicon.ico',
head: [
{ elem: 'css', url: '_index.css', ie: false },
{ elem: 'css', url: '_index.ie.css', ie: 'gte IE 6' },
{ elem: 'meta', attrs: { name: 'description', content: '俺の考えた最強のBEM' }}
],
content:[
({
block: 'page',
title: '俺が考えた最強のタイトル',
favicon: 'favicon.ico',
head: [
{ elem: 'css', url: '_index.css', ie: false },
{ elem: 'css', url: '_index.ie.css', ie: 'gte IE 6' },
{ elem: 'meta', attrs: { name: 'description', content: '俺の考えた最強のBEM' }}
],
content:[
block goods {
tag: 'ul'
content: {
var content = [];
this.ctx.goods.forEach(function(item){
var mods = {};
if (item.new) mods.new = 'yes';
content.push({
elem: 'item',
.goods
{
margin: 20px 0;
margin-right: -30px;
padding: 0;
list-style: none;
font-size: 0;
}
.goods__item