Skip to content

Instantly share code, notes, and snippets.

View axross's full-sized avatar
🍣
= 🍚 + 🐟 + ❤️

Kohei axross

🍣
= 🍚 + 🐟 + ❤️
View GitHub Profile
// 10未満の自然数のうち, 3 もしくは 5 の倍数になっているものは 3, 5, 6, 9 の4つがあり, これらの合計は 23 になる.
// 同じようにして, 1000 未満の 3 か 5 の倍数になっている数字の合計を求めよ.
const main = limit => {
let total = 0;
for (let i = 1; i < limit; ++i) {
if (i % 5 === 0) {
total += i;
} else if (i % 3 === 0) {
@axross
axross / .eslintrc
Last active August 29, 2015 14:24
.eslintrc
{
"parser": "babel-eslint",
"plugins": [
"react"
],
"env": {
"browser": true,
"node": true,
"mocha": true,
},
@axross
axross / gist:9a21ebeee8c57fbe47a7
Created June 5, 2015 04:22
Two direction data binded Textbox
import bemmer from 'bemmer';
import React from 'react';
const AxuiTextbox = React.createClass({
propType: {
value: React.PropTypes.func,
onChange: React.PropTypes.func,
onKeyDown: React.PropTypes.func,
onKeyUp: React.PropTypes.func,
onKeyPress: React.PropTypes.func,
@axross
axross / littlenoar_coop.es6
Last active August 29, 2015 14:17
リトルノアの部屋番号自動で見に行くやつ
import moment from 'moment';
import cheerio from 'cheerio';
import request from 'superagent';
const LEVEL_NUM = 8;
const MAP_NUMS = [4, 5];
var _url = 'http://wiki.famitsu.com/littlenoah' +
'/COOP%E5%8B%9F%E9%9B%86%E6%8E%B2%E7%A4%BA%E6%9D%BF' +
'/%E3%82%A8%E3%83%AA%E3%82%A2' + LEVEL_NUM;
import is from 'is_js';
// メールアドレスサンプル
// 引用元 : http://qiita.com/mpyw/items/257eabe0b43b1e02e6f7
const emails = [
'[email protected]',
'[email protected]',
'user+mailbox/[email protected]',
"!#$%&'*+-/=?^_`.{|}[email protected]",
'"Abc@def"@example.com',
@axross
axross / modifier_sample.less
Last active August 29, 2015 14:17
ReactでBEMなclassNameを書きやすくするBemmerというライブラリを作った
.exButton {
color: black;
&--isOdd { color: red; }
&--isEven { color: blue; }
}
@axross
axross / user_code.js
Last active August 29, 2015 14:15
Isomorphic_model
var Post = Model.createModel({
id: {
type: Number,
validators: ['isNumber'],
},
body: {
type: String,
validators: ['isString']
},
user: {
@axross
axross / gulpfile.js
Last active August 29, 2015 14:11
ライブコーディングでつかうクソgulpfile
var path = require('path');
var gulp = require('gulp');
var plumber = require('gulp-plumber');
var rename = require('gulp-rename');
var webpack = require('gulp-webpack');
var browserSync = require('browser-sync');
var modRewrite = require('connect-modrewrite');
gulp.task('bundle', function() {
gulp.src('./public/app.jsx')
@axross
axross / file0.less
Last active August 29, 2015 14:06
Google material designのColor定義のlessファイル書いた ref: http://qiita.com/axross/items/a5013511dac77be4f83b
//
// Colors
//
@red50: #fde0dc;
@red100: #f9bdbb;
@red200: #f69988;
@red300: #f36c60;
@red400: #e84e40;
@red500: #e51c23;
@red600: #dd191d;
{
"name": "myapp"
"scripts": {
"start": "node app.js",
"production": "NODE_ENV=production node app.js"
}
}